toggle element's visibility to matching A class
I'm trying to make a "filterable" list. I have a dynamically created link list. I want the link to toggle the visibility of a matching element, dl's, class.
When the "All" link is clicked I want it to show all the hidden dls.
Does this make sense?
The filter is for a list of events and I'm filtering the list by category. Should be pretty simple, but I'm very new to jQuery.
-
function click_me(event){
var s = ".eventslist[id=" + this.id + "]";
$(".eventslist").toggle();
$(s).show();
$(this).toggleClass('selected');
$("ul#filterlist a.all").click(function(){
//show the hidden div
$(".eventlist").show("fast");
});
return false;
};
$(function(){
$(".menu A").click(click_me);
});
Thanks!