Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cache `element.hash`.

  • Loading branch information...
commit 13a163ec22ab475fe2b2c836a7bf3479646fedce 1 parent 82ef247
@mathiasbynens authored
Showing with 4 additions and 4 deletions.
  1. +2 −2 jquery.smoothscroll.js
  2. +2 −2 jquery.smoothscroll.min.js
View
4 jquery.smoothscroll.js
@@ -1,4 +1,4 @@
-/*! http://mths.be/smoothscroll v1.5.1 by @mathias */
+/*! http://mths.be/smoothscroll v1.5.2 by @mathias */
;(function(document, $) {
var $scrollElement = (function() {
@@ -34,7 +34,7 @@
event.preventDefault();
// …and smoothly scroll to it
$scrollElement.stop().animate({ 'scrollTop': $hash.offset().top }, speed, function() {
- location.hash = hash.id;
+ location.hash = hash;
});
}
}
View
4 jquery.smoothscroll.min.js
@@ -1,2 +1,2 @@
-/*! http://mths.be/smoothscroll v1.5.1 by @mathias */
-(function(a,c){var b=(function(){var d=c(a.documentElement),f=c(a.body),e;if(d.scrollTop()){return d}else{e=f.scrollTop();if(f.scrollTop(e+1).scrollTop()==e){return d}else{return f.scrollTop(e)}}}());c.fn.smoothScroll=function(d){d=~~d||400;return this.find('a[href*="#"]').click(function(f){var g=this.hash,e=c(g);if(location.pathname.replace(/^\//,'')===this.pathname.replace(/^\//,'')&&location.hostname===this.hostname){if(e.length){f.preventDefault();b.stop().animate({scrollTop:e.offset().top},d,function(){location.hash=g.id})}}}).end()}}(document,jQuery));
+/*! http://mths.be/smoothscroll v1.5.2 by @mathias */
+(function(a,c){var b=(function(){var d=c(a.documentElement),f=c(a.body),e;if(d.scrollTop()){return d}else{e=f.scrollTop();if(f.scrollTop(e+1).scrollTop()==e){return d}else{return f.scrollTop(e)}}}());c.fn.smoothScroll=function(d){d=~~d||400;return this.find('a[href*="#"]').click(function(f){var g=this.hash,e=c(g);if(location.pathname.replace(/^\//,'')===this.pathname.replace(/^\//,'')&&location.hostname===this.hostname){if(e.length){f.preventDefault();b.stop().animate({scrollTop:e.offset().top},d,function(){location.hash=g})}}}).end()}}(document,jQuery));
Please sign in to comment.
Something went wrong with that request. Please try again.