Difference between revisions of "Template:Washington"
Line 275: | Line 275: | ||
<!-- End of CSS --> | <!-- End of CSS --> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
− | + | var jump=function(e) | |
− | + | { | |
− | + | if (e){ | |
− | + | e.preventDefault(); | |
− | + | var target = $(this).attr("href"); | |
− | + | }else{ | |
− | + | var target = location.hash; | |
− | + | } | |
− | + | ||
− | + | ||
− | + | $('html,body').animate( | |
− | + | { | |
− | + | scrollTop: $(target).offset().top | |
− | + | },2000,function() | |
− | + | { | |
− | + | location.hash = target; | |
− | + | }); | |
− | + | } | |
− | + | $('html, body').hide(); | |
− | + | $(document).ready(function() | |
− | + | { | |
− | + | $('a[href^=#]').bind("click", jump); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | if (location.hash){ | ||
+ | setTimeout(function(){ | ||
+ | $('html, body').scrollTop(0).show(); | ||
+ | jump(); | ||
+ | }, 0); | ||
+ | }else{ | ||
+ | $('html, body').show(); | ||
+ | } | ||
+ | }); | ||
</script> | </script> | ||
Revision as of 23:16, 10 September 2015