Created
November 20, 2012 20:02
-
-
Save seliopou/4120660 to your computer and use it in GitHub Desktop.
A Conditional Animation Pattern for d3 - script tag
This file contains 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
<form> | |
<input id="back_detect" type="hidden" name="back_detect" value="" /> | |
</form> | |
<script type="text/javascript"> | |
/* Render vis, animating only if value is set to "" */ | |
vis("#canvas", $("#back_detect").val() == ""); | |
/* | |
* Set the value of the form field to "visited". Most browsers will | |
* preserve this when the user navigates with the back button. | |
*/ | |
$("#back_detect").val("visited"); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment