Jump to content

jQuery attr doesn't actually work on images?


Mudsaf

Recommended Posts

so im wondering how i can make my script work on mouse enter function. ATM

<script>$(function() {$(".infoTD_image").mouseenter(function() {$(this).attr('src', 'MY_NEW_URL');console.log("ENTER: " + $(this).attr('src'));}).mouseleave(function() {$(this).attr('src', 'MY_OLD_URL');console.log("LEAVE: " + $(this).attr('src'));});});</script><img class='infoTD_image' src='MY_OLD_URL'>

So my script works and it displays the Src changes, but somehow the image wont really change.

Edited by Mudsaf
Link to comment
Share on other sites

Well as you see at table on index page the "lue lisää" images aint changing for me. http://poverihanke.mudsaf.info/ You can easily find starting line of modified code by "Source Code" & line

<!-- MODIFIED WP-DATA 25.04.2013 Mudsaf -->

Edited by Mudsaf
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...