/ Published in: jQuery

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//if clicked item is already selected, ignore the click /* if($(this).hasClass('selected')){ $(this).find('div').hide(300).end().animate({'width' : "200", 'height' : "200"}, 200).removeClass('selected').find("p.thumb").show(); return; } /* if ($('h1').is(':visible')) { $('h1').hide(); } else { $('h1').show(); } */ //if an item in the menu is selected, close it, hide children, remove selected /* $("#grid li.selected").find('div').hide(200).end().animate({'width' : "200", 'height' : "200"}, 300).removeClass('selected').find("p.thumb").show(); */ //open the clicked item // add the 'selected' class in order to know what was opened for the next click $(this).find("p.thumb").hide().end().find('div').show(300).end().animate({width: "900", height: "660"}, 300).addClass('selected'); //add the 'selected' class in order to know what was opened for the next click /*$(this).addClass('selected');*/
Comments
