UNPKG

tram

Version:

Cross-browser CSS3 transitions in JavaScript

35 lines (28 loc) 921 B
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>tram.js example</title> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <link rel="stylesheet" href="../support/styles/example.css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="../node_modules/jquery/dist/jquery.min.js"><\/script>')</script> <script src="../dist/tram.js"></script> </head> <body> <p> Modify transition settings during a queued sequence. </p> <div class="test"></div> <script> var test = $('.test'); tram(test) .add('transform 500ms ease') .set({ x: 0 }) .start({ x: 200, wait: 400 }) .then('transform 800ms ease-in-out-expo') .then({ x: 0 }); </script> </body> </html>