Skip to content

Instantly share code, notes, and snippets.

@travismillerweb
Created August 11, 2012 01:05
Show Gist options
  • Save travismillerweb/3319682 to your computer and use it in GitHub Desktop.
Save travismillerweb/3319682 to your computer and use it in GitHub Desktop.
jQuery - Image Over Opacity
<html>
<head>
<title>Image over Opacity</title>
<link rel = "stylesheet" href = "">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type = "text/javascript">
jQuery(function(){
$("img").bind({
mouseover:function() {$(this).stop(true).fadeTo(300, 1.0);},
mouseout: function() {$(this).stop(true).fadeTo(300, 0);}
});
});
</script>
<script type = "text/css">
img.casper {
position:absolute;
}
</script>
</head>
<body>
<h1> Image over Opacity </h1>
<img src = "http://www.mobilechilli.com/images/bc/gb/products/J/138979.gif" alt = "Casper" title = "Casper" class = "casper" />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment