Hello. Help me find a plugin like on http://fast-torrent.ru/. In the menu there is a button "Other genres", by clicking on it additional genres are moved apart.
2 answers
<ul> <li>lalala</li> <li>lalala</li> <li class="showmore">show more</li> <li>lalala</li> <li>lalala</li> <li>lalala</li> <li>lalala</li> </ul> <script type="text/javascript"> $(function(){ $('ul .showmore').nextAll('li').hide(); $('ul .showmore').click(function(){ $(this).nextAll('li').show().end().remove(); }); }); </script> The appearance effect can be changed. JQuery is used.
|
Actually, what is the difficulty? Hiding hidden elements in the block, and by clicking on the "other genres" make slideDown () - if on jQuery. Here is a schematic:
<!-- разметка --> <li id="clickMe">Другие жанры</li> <div class="hideClass" id="showMe"> ... <li>жанр</li> <li>жанр</li> ... </div> /* CSS */ .hideClass{ display: none;} /* jQuery script */ $("#clickMe").click(function(){ $(".hideClass").slideDown("fast").show();//Показали список $(this).hide();//Спрятали пункт "другие жанры" }); - The fact is that in js I am 0, and I am not able to write / add a menu either) for this I ask for a complete menu preparation - dogmar
- Blanks brought me and Comrade @ling - use! And since you cannot even add to the menu, maybe you should first deal with the layout, and only then climb into the scripts? IMHO, of course. - metazet
- so I have a website and on it the engine that I wrote myself)) but the only one without js, well, let's say the code for comrade @ling I copied pasted into html, everything that was printed in li .. just stupidly output, you probably need to connect which then the library? or what? - dogmar
- In both answers it is written that you need to connect [jQuery] [1] [1]: docs.jquery.com/Downloading_jQuery - metazet
|