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

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

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -