-
Sep 2nd, 2011, 04:01 AM
#1
Thread Starter
Addicted Member
[RESOLVED] how to use this jquery code?
$("#myContentRegion").delegate("img", "hover", function(){
$(this).animate({
width: 200, height: 200
}, 5000, function() {
$(this).animate({ width: 100, height: 100 });
});
});
found above code on this link: http://stackoverflow.com/questions/3...nerated-images
how do i use it on my html page? please help.. thanks
The taller the bamboo grows the lower it bends...
-
Sep 2nd, 2011, 05:55 AM
#2
Re: how to use this jquery code?
Hw about this one
Code:
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
</head>
<body>
Image over demo
<div id="myContentRegion">
<img src="http://techreceipe.com/wp-content/uploads/2011/06/InterExpl-Cannot-display-the-page.jpg" height="100" width="100" alt="Angry face" />
</div>
<script>
$("#myContentRegion").delegate("img", "hover", function(){
$(this).animate({
width: 200, height: 200
}, 5000, function() {
$(this).animate({ width: 100, height: 100 });
});
});
</script>
</body>
</html>
Demo here
Last edited by danasegarane; Sep 2nd, 2011 at 06:18 AM.
Reason: Demo link
Please mark you thread resolved using the Thread Tools as shown
-
Sep 2nd, 2011, 06:06 AM
#3
Re: how to use this jquery code?
Another Example
Code:
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script>
$(document).ready(function(){
$('#myimage').width(200);
$('#myimage').mouseover(function()
{
$(this).css("cursor","pointer");
$(this).animate({width: "500px",height:"500px"}, 'slow');
});
$('#myimage').mouseout(function()
{
$(this).animate({width: "200px",height:"200px"}, 'slow');
});
});
</script>
</head>
<body>
Image over demo
<div id="myContentRegion">
<img id="myimage" src="http://techreceipe.com/wp-content/uploads/2011/06/InterExpl-Cannot-display-the-page.jpg" height="100" width="100" alt="Angry face" />
</div>
</script>
</body>
</html>
Demo here
Last edited by danasegarane; Sep 2nd, 2011 at 06:14 AM.
Reason: Demo
Please mark you thread resolved using the Thread Tools as shown
-
Sep 3rd, 2011, 12:29 AM
#4
Thread Starter
Addicted Member
Re: how to use this jquery code?
hi danasegarane, thank you so much bro for your help
The taller the bamboo grows the lower it bends...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|