Scrolling al ocultar/mostrar un Div con Jquery

socratess

Lanero Reconocido
15 Nov 2007
1,467
Hola si alguien sabe porque me esta pasando lo siguiente: Cuando le doy click a un botón el mouse se desplaza a la parte inferior del contenido que muestro. Quisiera saber porque y como arreglarlo. EL mouse no se deberia desplazar

Código:
https://www.youtube.com/watch?v=IwQzXWWDUdI&feature=youtu.be

Código:
jQuery(document).ready(function( $ ){

$(".button").on("click", function(e){
var posBut = $(".button").index(this),
tab = $(".tab").eq(posBut),
aux;
e.preventDefault();

if ((aux = $(".visible")))
{ // If there is an element with the class "visible"
aux.removeClass("visible").slideToggle("slow"); // I take it off and the hidden
$('.button').toggleClass('opened closed');

}

if (aux[0] != tab[0])
{ // If the element equivalent to the button pressed is different from the
one that has the class "visible"
tab.addClass("visible").slideToggle("slow"); // I assign this class
$('.button').toggleClass('opened closed');

}

});
});
 

Los últimos temas