$(document).ready(function(){ $(function(){ $('a[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) { var targetOffset = $target.offset().top; $('html,body').animate({scrollTop: targetOffset}, 1000); return false; } } }); }); $(window).scroll(function() { // Menu fixed if($(this).scrollTop() > 100){ $('.content_menu').addClass('menu_fixed'); }else{ $('.content_menu').removeClass('menu_fixed'); } // Resolución superior a 1050px if ($(this).width() >= 1050) { if($(this).scrollTop() > 390){ $('#inicio').fadeIn(1000); }if($(this).scrollTop() > 960){ $('.services_row > div > div').fadeIn(1000); }if($(this).scrollTop() > 2000){ $('.porta_body').show('slow'); } } // Resolucón de laptop else if($(this).width() < 1050 && $(this).width() >= 800){ } // Resolución Tablet else if($(this).width() < 800 && $(this).width() >= 768){ } // Resolución movil else if($(this).width() < 768 && $(this).width() >= 568){ } else if($(this).width() < 568){ } }); });