I have a function within a function and need to setup the click event on an anchor tag to do a jquery animation.
My alert fires, but i'm having trouble addressing the div with the correct ID using query. At least, I'm assuming it's a scope issue . . . the jquery slideToggle method never fires... any ideas?
This code is part of a .js file that gets included into my html file which has plenty of dynamic stuff happening in it. I had the slideToggle working, but must now address similar elements which are on a varying number of dynamically created pages (hence the loop).
relatively new to jquery/javascript... any insight is appreciated!
mainfunction = function() {
//do some other stuff, other methods, etc.
secondaryfunction = function() {
a loop happens here {
var bst = 'bsawToggle'+i;
var bsawtoggle = $("#"+bst.toString()); //i know this is redundant - playing around here
bsawtoggle.click(function(){
var bs = 'bsaw'+i;
$("#"+bs.toString()).slideToggle('slow');
$(this).toggleClass('slideSign');
alert("clicked bandsaw toggle"); // this alert works!
//return false;
});
} //loop ends
}
}