RSS

code zone jQuery Crash Course – Day 5 | Working with images

06 Mar

Changing image opacity


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">

$('document').ready(function(){

$('#myDiv img').hover(function(){

$(this).animate({"opacity" : "0.5"});
},

function(){
$(this).animate({"opacity" : "1.0"});
});
});

</script>
</head>

<body>

<div id="myDiv">
<img src="image.jpg" width="113" height="113" /></div>
</body>
</html>


Advertisements
 
Leave a comment

Posted by on March 6, 2012 in Uncategorized

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: