Buenas,
tengo implementado un script que al pulsar en un enlace hace scroll hacia abajo, hacia un punto concreto. Funciona bien en IE y Firefox, pero no en Opera, Safari y Chrome.
Pongo el script:
Código Javascript
:
Ver original(function(){
//////////////// VARS ///////////////////////
var $jQ = jQuery.noConflict(),
$HdHeight = $jQ('#header').height(),
$Wrapper = $jQ('body,html'),
$WindowPage = $jQ(window);
/********************************************
SC-ANIMATION SCROLL
*********************************************/
var animationScroll = animationScroll || {};
animationScroll = {
$ParentElement : $jQ('body, html'),
$NavLink : $jQ('#nav a, [data-action="animation-scroll"]'),
init : function() {
(this.$NavLink).click(this.animation);
},
animation : function(event) {
var targetHref = this.hash.replace('#','');
// change class in nav menu
(animationScroll.$NavLink).removeClass('active');
$jQ(event.target).addClass('active');
// animate scroll to section
(animationScroll.$ParentElement).stop(true,true).animate({
scrollTop: $jQ("section[id*='" + targetHref + "']").offset().top
}, 1000);
event.preventDefault();
}
};
animationScroll.init();
})();