Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- smooth scroll
- $('a[href*="#"]:not([href="#"])').click(function() {
- if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
- var target = $(this.hash);
- target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
- if (target.length) {
- $('html, body').animate({
- scrollTop: target.offset().top
- }, 1000);
- return false;
- }
- }
- });
- scroll - height menu fixed
- $('a[href^="#"]:not([href="#"])').on('click',function (e) {
- e.preventDefault();
- var target = this.hash;
- var $target = $(target);
- console.log(target);
- if(target == "#produccion"){
- $('html, body').stop().animate({
- 'scrollTop': $target.offset().top - 65
- }, 900, 'swing', function () {
- window.location.hash = target;
- });
- }else{
- $('html, body').stop().animate({
- 'scrollTop': $target.offset().top - 48
- }, 900, 'swing', function () {
- window.location.hash = target;
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment