Try to use the following code to set image effect on mouseover
HTML Code:
<style type="text/css">
#demo_this
{
list-style-type: none;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
$(function() {
$("#demo_this img").hover(function() {
$(this).attr("src", $(this).attr("src").split(".").join("-hover.")); // adds -hover to the name of the image
}, function() {
$(this).stop(true,false); // prevents the creation of stacked actions
$(this).attr("src", $(this).attr("src").split("-hover.").join(".")); // removes -hover from the name of the image
});
});
}); // end docready
</script>
<h1> Abbreviated Method Calls</h1>
<p>From: <a target="_blank" href="http://www.techarena.in">JQuery Rollovers Using this </a></p>
<p>This is simple rollover done easier in CSS </p>
<p> </p>
<ul id="demo_this">
<li><a href="#"><img src="/images/item1.gif" border="0" /></a></li>
<li><a href="#"><img src="/images/item2.gif" border="0" /></a></li>
<li><a href="#"><img src="/images/item3.gif" border="0" /></a></li>
</ul>
Bookmarks