Difference between revisions of "Template:Washington"

Line 278: Line 278:
 
      
 
      
 
<script type="text/javascript">
 
<script type="text/javascript">
$(function() {
+
$('a[href*=#]:not([href=#])').click(function() {
  $('a[href*=#]:not([href=#])').click(function() {
+
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')  
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
+
        || location.hostname == this.hostname) {
  
      var target = $(this.hash);
+
        var target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
+
        target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
      if (target.length) {
+
          if (target.length) {
        $('html,body').animate({
+
            $('html,body').animate({
          scrollTop: target.offset().top
+
                scrollTop: target.offset().top
        }, 1000);
+
            }, 1000);
        return false;
+
            return false;
      }
+
        }
    }
+
    }
  });
+
});
});
+
 
</script>
 
</script>
 
</head>
 
</head>

Revision as of 18:56, 11 September 2015