O
O
One of Us2018-01-20 19:17:54
PHP
One of Us, 2018-01-20 19:17:54

How to make the block with full information open below the row?

Hello!
Please explain how this block behavior is implemented. For example, as in the "Mediamarkt", we click on the "Show all" button in the catalog and below this row of blocks a block with full information appears. And each time below a certain number. Thanks a lot.
https://mediamarkt.ru/catalog (Not advertising).

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
dodo512, 2019-11-06
@reds

Just a demonstration of the possibilities of the PCRE library.
https://regex101.com/r/PUQP9o/3
https://rextester.com/XZMZK18309

$str = 'колесо';
$letters = preg_split('//u', $str, -1, PREG_SPLIT_NO_EMPTY);

foreach ($letters as $i => &$letter) {
    $letter .= '(?!\\g' . ($i + 1) . ')()';
}

$regex = '#^(?:'.implode('|', $letters).')++$#u';

echo $regex, PHP_EOL;

$words = array ('колесо','колосс','оселок');

var_dump(preg_grep($regex, $words));

H
Harland Sanders, 2019-11-07
@lordKelvin

^(?:([еклс])(?!.*\1))*(?:о(?:([еклс])(?!.*\2))*){0,2}$

Reference: perlre .
I want to point out that the regular expression is not the best or just a readable solution to this problem.

N
Nadim Zakirov, 2019-11-06
@zkrvndm

Try like this:

$poisk = preg_grep("/[колесо][колесо][колесо][колесо][колесо][колесо]/", $slova);

S
serik, 2018-01-20
@Vlados102rus

Alternatively, you can divide the product catalog into 3 divs (depending on the number of categories)
And between the first and second divs, display a block with complete information, which will be filled depending on the selected product category / depending on the button pressed. And so it is similar for each level... you manipulate all this on js.

<div>
    <div></div>
    <div></div>
    <div></div>
     ...
</div>
<div style="display: none"></div>
<div>
    <div></div>
    <div></div>
    <div></div>
     ...
</div>
<div style="display: none"></div>
<div>
    <div></div>
    <div></div>
    <div></div>
     ...
</div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question