[Resolvido] Exibir / Ocultar DIV
Hey folks!
Estou carregando o jquery no magento e estou com uma função básica para exibir e esconder uma div, o problema é que não esta funcionando somente no meu sistema, rodando ela pelo jsFiddle funciona corretamente.
código
visibleItem = null;
timer = null;
show = function(selector){
if(visibleItem && visibleItem!=selector){
scheduleCancel();
hideInstant();
}
if(timer){
scheduleCancel();
}
visibleItem = selector;
$(selector).fadeIn('fast');
}
scheduleCancel = function (){
clearTimeout(timer);
timer = null;
}
scheduleHide = function (){
if(timer){
scheduleCancel();
}
timer = setTimeout(function(){
hide();
}, 400);
}
hide = function (){
$(visibleItem).fadeOut('fast');
visibleItem = null;
timer = null;
}
hideInstant = function (){
$(visibleItem).css('display', 'none');
visibleItem = null;
timer = null;
}
$("li#login-mini").mouseenter(function() {
show('.mini-login-form');
});
$("li#login-mini").mouseleave(function() {
scheduleHide();
});
$(".mini-login-form").mouseenter(function() {
scheduleCancel();
});
$(".mini-login-form").mouseleave(function() {
scheduleHide();
});
Link para ver a função funcionando. http://jsfiddle.net/WcUFe/70/
existe algo incorreto?
Discussão (6)
Carregando comentários...