Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. $(function() {
  2. $('a[href*=#]:not([href=#]),a[href*=#]:not(a[data-toggle])').click(function() {
  3. if (location.pathname.replace(/^//,'') == this.pathname.replace(/^//,'') && location.hostname == this.hostname) {
  4.  
  5. var target = $(this.hash);
  6. target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
  7. if (target.length) {
  8. $('html,body').animate({
  9. scrollTop: target.offset().top
  10. }, 1000);
  11. return false;
  12. }
  13. }
  14. });
  15. });
  16.  
  17. $('a[href*=#]:not([href=#]),'a[href^="#"]:not([data-toggle])').click(function() {
  18. ^^^ - extra and unnecessary character
  19.  
  20. $('a[href*=#][class*="smooth"]:not([href=#])').click(function()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement