I am trying to do a simple image rollover via jQuery. When I use the jQuery that is included with my wordpress 3.3.1 installation:
/wp-includes/js/jquery/jquery.js?ver=1.7.1
my image rollover effect does not work.
If I include a link to the same version jQuery library, for example:
http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
the rollover image effect works.
Here is the code I am using for the jQuery rollover effect.
<script type="text/javascript">
jQuery(function(){
$(".img-swap").hover(
function(){this.src = this.src.replace("_off","_on");},
function(){this.src = this.src.replace("_on","_off");
});
});
</script>
And here is the code of the trigger image:
<img src="http://www.huntingtonbeachpizza.com/wp-content/themes/pizzalounge/images/header/facebook_off.png" alt="" class="img-swap" />
Can anyone shed some light on this?
If i leave the link from Google to the jQuery library my rollover will work, but I am afraid of creating some kind of conflict with the currently bundled jQuery that comes installed in ,y WordPress 3.3.1 installation.
Thanks in advance
Here is a link to my site to view the page with the rollover applies and view the page source if needed:
Thanks