[jQuery] Filter and fade problems
Hi, to all
I have never worked with javascripts, but I have to do something in
my web,that needs a javascript.
The problem is that I want to present my architectural projects by
category. I have about 6 menus(each menu represents a category) and a
big layer below it. Automatically all thumbs (in <div>s) are in that
layer and all are visible as a grid. And when I click a "Menu-a" all
other thumbs except that thumbs belong "Menu-a" have to fade(disappear/
hide). And when I want click it again all thumbs must appear again,
and apply this function to all categories.
I found some codes for make it fade and toggle but toggling only makes
it appear or fade:
<SCRIPT language="javascript">
jQuery.hiddenTags = false;
settag = function(cname) {
var space = cname.indexOf(' ');
return cname.substring(4, space);
}
$('a.tag').toggle(
function() {
tag = settag($(this).attr('class'));
divtag = 'div.tag_'+tag;
atag = 'a.tag_'+tag;
if(!jQuery.hiddenTags) {
$('div.tag').fadeOut('slow');
jQuery.hiddenTags = true;
}
$(divtag).slideDown('slow');
$(atag).toggleClass(menuselected');
},
function() {
tag = settag($(this).attr('class'));
divtag = 'div.tag_'+tag;
atag = 'a.tag_'+tag;
$(divtag).slideUp('slow');
$(atag).toggleClass('menuselected');
}
)
</SCRIPT>
Please, can anyone help me.I am investigating about some scripts and
effects about 2 months. I am architect student and wanted to do my own
webpage.