1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| <!DOCTYPE html>
<html lang="fr" dir="ltr">
<head>
<meta http-equiv="cache-control" content="public, max-age=60">
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0">
<meta name="author" content="Daniel Hagnoul">
<title>Test</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/sunny/jquery-ui.css">
<style>
#page_1 { position: relative; background-color: yellow; border: 2px solid red; width: 200px; height: 200px; margin-top: 300px; }
</style>
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script>
"use strict";
function getType( Obj ){
return Object.prototype.toString.call( Obj ).match( /\s([a-zA-Z]+)/ )[ 1 ].toLowerCase();
}
$( function(){ // forme abrégée de $(document).ready(function(){
var ScreenHeight = "-=200px"; // déplacement relatif de - 200px
$( "#bt_aboutus" ).one( "click", function(){ // one : une seule fois; on : plusieurs fois
$( "#page_1" ).animate( { "marginTop" : ScreenHeight } , 800, "easeInOutQuad" );
});
});
$( window ).load( function(){
});
</script>
</head>
<body>
<button id="bt_aboutus">bt_aboutus</button>
<div id="page_1"></div>
<script src="https://google.github.io/traceur-compiler/bin/traceur.js"></script>
<script src="https://google.github.io/traceur-compiler/src/bootstrap.js"></script>
<script type="module">
</script>
</body>
</html> |
Partager