Scoping issues with Jquery slideToggle
I'm using slideToggle and wondering how to pass a variable to the callback
function. It traces back undefined. Any ideas? Cheers!
$('.drop-box .button').click(function(){
var target = $(this).parent();
var myVar = $(this);
target.slideToggle(300, function(myVar){
alert(myVar); // undefined
});
return false;
});
No comments:
Post a Comment