私は基本的にスープアップされたビジネス広告であるサイトを仕上げるのホームステイをしていますが、私はマウスの左にスライドしようとしている一連のliリンクに問題があります。SetTimeout関数のヘルプ
問題は基本的に、マウスセンターの機能はあまりにも敏感です。 IveはHoverIntentプラグインを調べましたが、プラグインが作成されたときにマウスセンターがサポートされていないjQuery関数であったため、マウスセンターをサポートしていないことを理解しています。だから私はSetTimeout関数を使うことにしましたが、正しく動作するようには思えません。ここで
は私がsetTimeout関数を実装しようとしているのjQueryの一部です:
$(document).ready(function() {
$('.home').mouseenter(function(){
$('.home').stop().animate({left:'55%'}, 1000)
$('#icon_home:hidden').delay(600).fadeIn(600);
}).mouseleave(function(){
$('.home').stop().animate({left:'50%'}, 1000)
$('#icon_home').hide();
$('.about').mouseenter(function(){
$('.about').stop().animate({left:'55%'}, 1000)
$('#icon_about:hidden').delay(200).fadeIn(600);
}).mouseleave(function(){
$('.about').stop().animate({left:'50%'}, 1000)
$('#icon_about').hide();
$('.contact').mouseenter(function(){
$('.contact').stop().animate({left:'55%'}, 1000)
$('#icon_contact:hidden').delay(200).fadeIn(600);
}).mouseleave(function(){
$('.contact').stop().animate({left:'50%'}, 1000)
$('#icon_contact').hide();
$('.services').mouseenter(function(){
$('.services').stop().animate({left:'55%'}, 1000)
$('#icon_services:hidden').delay(200).fadeIn(600);
}).mouseleave(function(){
$('.services').stop().animate({left:'50%'}, 1000)
$('#icon_services').hide();
});
});
});
});
//Hidden icons
$('#icon_home').hide();
$('#icon_about').hide();
$('#icon_contact').hide();
$('#icon_services').hide();
});
は、HTML:
<div id="icon_home"><img src="Icons/home.png" width="60" height="60" /></div>
<div id="icon_about"><img src="Icons/about.png" width="60" height="60" /></div>
<div id="icon_contact"><img src="Icons/contact.png" width="60" height="60" /></div>
<div id="icon_services"><img src="Icons/services.png" width="60" height="60" /></div>
<div id="thumb">
<ul>
<li class="home"><a rel="images/gallery/thumb/home.png" src="images/gallery/home.png" a href=" http://gmdcpa.com">
<img src="images/gallery/thumb/home.png" border="0" alt="" /></a></li>
<li class="about"><a rel="images/gallery/thumb/about us.png" src="images/gallery/about us.png" a href="http://gmdcpa.com">
<img src="images/gallery/thumb/about us.png" border="0" alt="" /></a></li>
<li class="contact"><a rel="images/gallery/thumb/Contact Us.png" src="images/gallery/Contact Us.png" a href="http://gmdcpa.com">
<img src="images/gallery/thumb/Contact Us.png" border="0" alt="" /></a></li>
<li class="services"><a rel="images/gallery/thumb/Services.png" src="images/gallery/Services.png" a href="http://gmdcpa.com">
<img src="images/gallery/thumb/Services.png" border="0" alt="" /></a></li>
</ul>
</div>
私の質問は、私は1つの関数にこれらを組み合わせることする必要がありますか?もしそうなら、どのようにすればいいのですか?また、マウスの領域をすばやくドラッグすることでアニメーションが呼び出されないように、SetTimeoutを実装するためにはどうすればいいですか?前もって感謝します。
あなたのHTMLも共有してください。また、最初のリンクは他のリンクとは目的が異なることがありますか? – Niklas
あなたのマウスの休暇のように見えますが、それに続くものはすべてです。 '});'最後に... 'stop(true、true)'を使用して以前のアニメーションをクリアします – Val