Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var scrollingOffset = function() {
- var headerHeight = $('.header').outerHeight();
- var id = window.location.hash.substr(1);
- $('.mainmenu a[href*="#"]').on('click', function(e) {
- var anchor = $(this.hash);
- if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') ||location.hostname == this.hostname) {
- anchor = anchor.length ? anchor : $('[name=' + this.hash.slice(1) + ']');
- if (anchor.length) {
- $("html, body").animate({
- scrollTop: anchor.offset().top - headerHeight
- }, 1500);
- return false;
- }
- }
- });
- if (id != '' && $('#'+id).length>0) {
- if(id.indexOf('comment')>=0)$('.tab-product a[href="#reviews"]').tab('show');
- $("html, body").animate({
- scrollTop: $("#" + id).offset().top - headerHeight
- }, 1500);}
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement