Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.menu-item a').click(function() {
- // console.log(this.hostname);
- // console.log(location.hostname);
- // console.log(location.origin);
- // console.log(location.hash);
- if(this.hostname === location.hostname)
- {
- console.log(this.pathname+this.hash);
- console.log(location.pathname);
- if(location.pathname == "/" || location.pathname == "" || location.pathname == " " || location.pathname == this.pathname)
- {
- var target = $(this.hash);
- target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
- if (target.length) {
- $('html, body').animate({
- scrollTop: target.offset().top
- }, 900);
- // return false;
- }
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement