Difference between revisions of "Template:Washington"

Line 277: Line 277:
 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
 
<script type="text/javascript">
 
<script type="text/javascript">
jQuery(document).ready(function() {
+
 
   /**
+
$(document).ready(function() {
  * Scrolls smoothly to a specified element.
+
   $('a[href*="#"]').click(function() {
  *
+
    if (location.pathname == this.pathname && location.host == this.host) {
  * @param target_element
+
      var target = $(this.hash);
  * @returns {boolean}
+
      target = target.size() && target || $("[name=" + this.hash.slice(1) +']');
  */
+
      if (target.size()) {
  function smoothScrollTo(target_element) {
+
          target.ScrollTo(400);
    jQuery("html, body").animate({
+
          return false;
      scrollTop: (jQuery(target_element).offset().top)
+
      }
    }, 1000);
+
    };
    return false;
+
  });
  }
+
+
jQuery("a").click(function() {
+
smoothScrollTo(jQuery("#target-element"));
+
});
+
 
});
 
});
  

Revision as of 05:19, 11 September 2015