Last active
September 18, 2015 13:15
-
-
Save andrewconnell/5ab3e05cb309237be2cf to your computer and use it in GitHub Desktop.
OfficeUIFabric-AnimationDemo
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> | |
| <html> | |
| <head> | |
| <link href="//appsforoffice.microsoft.com/fabric/1.0/fabric.min.css" rel="stylesheet" /> | |
| <script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.4.min.js" type="text/javascript"></script> | |
| <style> | |
| .animation-container { | |
| position: relative; | |
| width: 100%; | |
| display: inline-block; | |
| overflow: hidden; | |
| } | |
| .animation-content { | |
| height: 100%; | |
| border: 1px solid gray; | |
| padding: 10px; | |
| } | |
| .animation-panel { | |
| position: absolute; | |
| top: 0px; | |
| width: 60px; | |
| height: 100%; | |
| opacity: 0; | |
| } | |
| </style> | |
| <script type="text/javascript"> | |
| function triggerAnimation(){ | |
| var panel = jQuery('.animation-panel'); | |
| // add animation | |
| var cssClass = 'ms-u-slideRightIn40'; | |
| panel.addClass(cssClass); | |
| // set timeout to remove the class on 1.5s | |
| setTimeout(function(){ | |
| panel.removeClass(cssClass) | |
| }, 1000); | |
| // disable events | |
| event.preventDefault(); | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <div class="animation-container"> | |
| <div class="animation-content" onclick="triggerAnimation();"> | |
| <hr /><hr /><hr /><hr /><hr /><hr /><hr /><hr /> | |
| </div> | |
| <div class="animation-panel ms-bgColor-themePrimary"></div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment