function - How to create both onClick and mouseover to a link jQuery -


i have script change main image on click link .feature_thumb class. want make it's both click , hover.

$(".feature_thumb").click(function(){     var main_href = $(this).attr('href');     change_image(main_href );  }); 

can me this?

i tried didn't work...

$(".feature_thumb").on('click hover') function(){     var main_href = $(this).attr('href');     change_image(main_href );  }); 

thank you

hover() jquery method shorthand $( selector ).mouseenter( handlerin ).mouseleave( handlerout ); in fact want mouseover:

$(".feature_thumb").on('click mouseover', function(){...}); 

or depending exact expected behaviour , html markup, use mouseenter.


Comments

Popular posts from this blog

xslt - Substring before throwing error -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

oracle - Changing start date for system jobs related to automatic statistics collections in 11g -