現在、オフ()メソッドを使用してホバー状態を無効にしています。 私のアクティブなリンクではないボタンの "on()"でホバーを再度有効にすることはできません。どんな助けでも大歓迎です!!jQuery 1.7のボタンでホバーを使用してon()およびoff()の状態を設定する
$(".datesmenu li").hover(function() {
$(this).stop(true, true).animate({
color: "#88bfdc",
duration: 200,
easing: "easeOutExpo",
complete: function() {}
});
}, function() {
$(this).stop(true, true).animate({
color: "#fff",
duration: 200,
easing: "easeOutExpo",
complete: function() {}
});
});
$(".datesmenu li").click(function(){
var index = $(this).prevAll().length;
for (var i = 0; i <= index; i++) {
if (i==index){
$('#d' + index).stop(true, true).delay(500).fadeIn("fast"), function() {}
$(this).off('hover');
$(this).css('color', '#88bfdc');
//$(this).removeAttr('href');
}
else{
$(".datesmenu li").not(this).css('color', '#fff');
$(".datesmenu li").not(this).on('hover', function(event) {event.preventDefault();});
$('#d' + i).fadeOut("fast");
}
}
});
Idrumgood-私はwork..Iへのソリューションがubind..Howeverを使用するようになってしまった得ることができなかった私は、このメソッドを使用する場合、私は私のrollovers..The色で私のアニメーションにイージングを失います変更内容が、アニメーションは??何らかの理由で削除される。これは、私はそれが仕事を得ることができる唯一の方法だったとして、あなたがより良いとクリーンなソリューションを持っている場合は、私に教えてください...
function init(){
$(".datesmenu li").mouseenter(hoverOn);
$(".datesmenu li").mouseleave(hoverOut);
}
$(".datesmenu li").click(function() {
var index = $(this).prevAll().length;
for (var i = 0; i <= 6; i++) {
if (i == index) {
$('#d' + index).stop(true, true).delay(500).fadeIn("fast"), function() {}
$(this).css('color', '#88bfdc');
$(this).unbind('mouseenter').unbind('mouseleave');
} else {
$('#d' + i).hide();
$(".datesmenu li").not(this).mouseenter(hoverOn);
$(".datesmenu li").not(this).mouseleave(hoverOut);
$(".datesmenu li").not(this).css('color', '#fff');
}
}
});
function hoverOn(e) {
$(e.target).stop(true, true).animate({
color: "#88bfdc",
duration: 200,
easing: "easeOutExpo",
complete: function() {}
});
}
function hoverOut(e) {
$(e.target).stop(true, true).animate({
color: "#fff",
duration: 200,
easing: "easeOutExpo",
complete: function() {}
});
}
init();
厥。 – ShankarSangoli