[jQuery] Need help using JQuery selectors
I am trying to use this jquery slide function that i found online. It's a
very basic slide plugin i suppose, which selects a div using the div's id
tag. I wanted to make my menu hide/reveal multiple divs and therefore I
modified this function that I keep in my .js file to make things work
theoretically. But for some reason I cannot get this to work and I think
that it might be that my selectors are implemented wrong in my js file. Here
is an example of what I've got which seems to work except for when I try my
modified code:
$(document).ready(function() {
$(".fadeNext_home").click(function(){
$("#home").fadeSliderToggle()
return false;
})
});
This is the code that works in my js file:
caller = this
if($(caller).css("display") == "none"){
$(caller).animate({
opacity: 1,
height: 'toggle'
}, settings.speed, settings.easing);
}else{
$(caller).animate({
opacity: 0,
height: 'toggle'
}, settings.speed, settings.easing);
}
};
And this is a modified version with my own selector that does not work. And
I think it's because of the way that I'm trying to interact with an id tag
that was not passed to the js file:
if($(caller).css("display") == "none"){
if($("#home").css("display") != "none"){
$("#home").animate({
opacity: 0,
height: 'toggle'
}, settings.speed, settings.easing);
}
I'm new to jquery (obviously) and would appriciate any help. Thanks so
much!
thanks,
wes
--
View this message in context: http://old.nabble.com/Need-help-using-JQuery-selectors-tp26159956s27240p26159956.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.