http://jsfiddle.net/MwQbE/
i have the jQuery Below but i cant get the variables to pass to the second function
$("img").hover(function(){
var $image = $(this);
var $imageNowWidth = $image.width();
},function() {
// get variable value for $image and $imageNowWidth
});
When testing on jsFiddle it doesn’t work, what can I do to pass the variable to the second function?
Simply define those 2 variables outside
.hoverand then you can use them inside mouseleave function. See below,Just want to clarify that
thiswill be available insidemouseleavefunction so you can do the same or more w.e you are doing insidemouseenter