Skip to content

Instantly share code, notes, and snippets.

@bobmaerten
Created November 13, 2011 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobmaerten/1362818 to your computer and use it in GitHub Desktop.
Save bobmaerten/1362818 to your computer and use it in GitHub Desktop.
Un peu d'animation
.affiche {
position: relative;
height: 260px;
overflow:hidden;
padding: 0;
}
.affiche img {
margin: 0;
padding: 0;
position: relative;
}
<div class="affiche">
<img id="pic" src="http://placehold.it/940x560" />
<div class="container">
<h1>Mon Super Site</h1>
<p>ou on y cause de tout et de rien...</p>
</div>
</div>
$(document).ready(function() {
function up() {
$("#plop").animate({"top": "-=200px"}, 1000, "linear", down);
}
function down() {
$("#plop").animate({"top": "+=200px"},1000, "linear", up);
}
up();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment