Monday, April 16, 2012

jquery click function and "new page"

i use jQuery "click" function. If use simple click on img is everything ok, but when on this image is link with tag 'target="_blank"' or user click right button, then 'open in new window', this function don't work.



How made that click function work, when user open link in new window?



My code:



$('.button_img').live('click', function(){
alert('new');
//do something
});

<a href="http://www.google.com" target="_blank">
<img class="button_img" src="img.png" />
</a>




No comments:

Post a Comment