I wont to perform action for the clicked li, as for expample toggle the nested ul
this is the html
<script type="text/javascript">
$(function() {
$('#verticalfade').verticalfade();
});
</script>
<div id="verticalfade_container">
<ul id="verticalfade">
<li>Le Collezioni
<ul>
<li>Link 1</li>
<li>Link 2</li>
</ul>
</li>
<li>Extra Plus
<ul>
<li>Link 1</li>
<li>Link 2</li>
</ul>
</li>
</ul>
</div>
This is the javascript:
(function($){
$.fn.extend( {
verticalfade: function(options){
var defaults = {
speed: 'normal'
};
var options = $.extend(defaults, options);
$('ul#verticalfade li ul').each(function(){
$('ul#verticalfade li ul').hide();
});
$('ul#verticalfade li').each(function(){
$(this).click(function(){
$(this).next('ul').toggle(500);
});
});
}
});
})(jQuery);
i hide all the sub ul in the list but i cannot define a function for each li to show the next ul only. i tried the next('ul') function but i can only toggle all the ul at once.