jQuery フェードイン効果に問題があります。これは実際にはこのウェブサイトにあります:ウェブサイトはこちら. この問題は、メイン メニューから任意のオプションを選択し、ページの読み込み中 (メニューがフェードイン) にメニュー ボタンをスライドすると発生します。次に、それらの一部 (フェード オーバーしていたもの) が表示されないか、わずかにフェードして表示されます。ボタンにこのコードを使用しました:
HTML:
<nav>
<a id="b1" href="index.html"><span>01. <strong>ABOUT US</strong></span><div></div></a>
<a id="b2" href="webdesign.html"><span>02. <strong>WEBSITE DESIGN</strong></span><div></div></a>
<a id="b3" href="mobile-websites.html"><span>03. <strong>MOBILE WEBSITES</strong></span><div></div></a>
<a id="b4" href="captive-portals.html"><span>04. <strong>CAPTIVE PORTALS</strong></span><div></div></a>
<a id="b5" href="portfolio.html"><span>05. <strong>PORTFOLIO</strong></span><div></div></a>
<a id="b6" href="contact-us.html"><span>06. <strong>CONTACT US</strong></span><div></div></a>
</nav>
Jクエリ:
$(document).ready(function(){
$("nav a").mouseenter(function () {
$('div', this).stop(true, false).animate({
'height': '65px'
}, 100);
$(this).stop(true, false).animate({
'padding-top': '5px'
}, 300);
}).mouseleave(function () {
$('div', this).stop(true, false).animate({
'height': '0px'
}, 300);
$(this).stop(true, false).animate({
'padding-top': '25px'
}, 500);
});
$('#b1, #b2, #b3, #b4, #b5, #b6, #b7').hide();
for (var i=1; i<99; i++) {
(function(i){
setTimeout(function() {
$('#b'+i).fadeIn(500);
}, 300+100*i);
})(i);
}
});
JS フィドルはこちら: http://jsfiddle.net/tucado/9hhZW/
(フェードイン中にマウスをボタンの上にスライドすると、私が何を意味するかがわかります)。基本的に、ボタンを通常どおりに表示して、マウスをボタンの上にスライドさせても、ボタンが 100% にフェードするのを妨げないようにしたいと考えています。
この問題の解決策を事前にありがとうございます。