Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
Created March 12, 2009 15:24
Show Gist options
  • Select an option

  • Save subtleGradient/78121 to your computer and use it in GitHub Desktop.

Select an option

Save subtleGradient/78121 to your computer and use it in GitHub Desktop.
CURRENT CODE:
<div>
<a href="something.html"><img src="myimage.gif" /></a>
</div>
CHANGED CODE:
<div>
<a href="something.html" class="out">
<img src="myimage.gif" class="out" />
<img src="myimage_over.gif" class="over" />
</a>
</div>
<style type="text/css">
a.out img.over { display:none; }
a.over img.out { display:none; }
</style>
<script>
window.addEvent('domready',function(){
$$('a.out').addEvents({
"mouseenter": function(e){
this.addClass('over').removeClass('out');
},
"mouseout": function(e){
this.addClass('out').removeClass('over');
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment