27-04-2011, 16:45
Tak mam ten kod, tylko przed tymi mouseover mam jeszcze kod slidera, w którym mi pomagałeś.. Wygląda to wszystko tak:
Przerobiłem to na mouseenter i mouseleave żeby sprawdzić czy tutaj jest błąd, ale dalej nie działa w IE, a w FF, Operze i Chrome śmiga jak trzeba.
Kod:
<script>
Cufon.replace('h1');
$(document).ready(function() {
var $sliders = $('.slider');
$sliders.each(function() {
var $current_slider = $(this);
var $lista = $('.lista', $current_slider);
var $li = $lista.children('li');
if ($li.length > 3) {
var odleglosc = $li.eq(0).outerWidth() + parseInt($li.eq(0).css('margin-left')) + parseInt($li.eq(0).css('margin-right'));
var maxLeft = odleglosc * $li.length - 3 * odleglosc;
$('.next', $current_slider).click(function() {
if ($lista.position().left > -maxLeft) {
$($lista).not(':animated').animate({
'left' : '-='+odleglosc
},500);
}
else {
$($lista).not(':animated').animate({
'left' : 0
},500);
}
});
$('.prev', $current_slider).click(function() {
if ($lista.position().left<0) {
$($lista).not(':animated').animate({
'left' : '+='+odleglosc
},500);
}
else if ($lista.position().left==0) {
$($lista).not(':animated').animate({
'left' : '-='+odleglosc
},500);
}
});
} else {
$('.next, .prev', $current_slider).click(function() {
$(this).preventDefault();
return false;
});
}
})
var offer_menu = $("div#offer-menu");
var offer = $("div.offer");
$(offer_menu).mouseenter(function(){
$(offer).slideDown("500");
$(offer).mouseenter(function(){
})
$(offer).mouseleave(function leave(){
$(offer).slideUp("500");
})
});
});
</script>
Przerobiłem to na mouseenter i mouseleave żeby sprawdzić czy tutaj jest błąd, ale dalej nie działa w IE, a w FF, Operze i Chrome śmiga jak trzeba.