I'd like to be able to define the variable which I can then use for other events, such as mouseout, mouseenter, click etc.
This is the current code:
$('a div')
// Get the width an height of the image
//var $img_width = $(this).children('img').width();
//var $img_height = $(this).children('img').height();
.mouseenter(function() {
alert($img_width)
})
.mouseleave(function() { // Animate the image back to it's original size
alert($img_width);
})
.each(function(index) {
alert($img_width);
});