Created
February 1, 2010 06:58
-
-
Save rjungemann/291508 to your computer and use it in GitHub Desktop.
A "moving clouds" example with JQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<!-- An example of using JQuery to make looping clouds. --> | |
<head> | |
<title>Transition Test</title> | |
<style> | |
#frame { | |
width: 600px; | |
height: 400px; | |
overflow: hidden; | |
} | |
#slider { | |
position: relative; | |
width: 1200px; | |
} | |
.one, .two { | |
width: 600px; | |
height: 400px; | |
float: left; | |
} | |
</style> | |
<script type="text/javascript" src="scripts/jquery.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
function resetAnimation() { | |
$("#slider").animate({ "left": "-=600px"}, 10000, function() { | |
$("#slider").css("left", "0"); | |
resetAnimation(); | |
}); | |
} | |
resetAnimation(); | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="header"> | |
<h1>Transition Test</h1> | |
</div> | |
<div id="frame"> | |
<div id="slider"> | |
<img src="images/clouds.jpg" class="one"> | |
<img src="images/clouds.jpg" class="two"> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment