I have this code:
$('.navigation a').on('click', function() {
$('.navigation').mouseleave(function() {
$('.navigation a').not('.bold').delay(2000).animate({opacity : 0}, 800, (function(){
$(this).css({'visibility': 'hidden'});
}));
});
$('.navigation').mouseenter(function() {
$('.navigation a').css({visibility: 'visible'});
$('.navigation a').animate({opacity : 1}, 800);
console.log('asdfasd');
});
});
The html:
<div class="navigation">
<p class="header">BLANC+EN?ENS</p>
<ul class="list">
<li><a alt="BLANC+EN?ENS PROFILE" href="/profile">BLANC+EN?ENS PROFILE</a></li>
<li><a alt="BLANC+EN?ENS SERVICES" class="on2" href="/services">BLANC+EN?ENS SERVICES</a>
<ul class="hide sub first list">
<li class="long"><a alt="BRAND CONSULTATIONS & STRATEGY" class="keep" href="/consultations">BRAND CONSULTATIONS & STRATEGY</a></li>
<li><a alt="STRATEGIC PARTNERSHIPS" href="/partnerships">STRATEGIC PARTNERSHIPS</a></li>
<li><a alt="INVESTMENT" href="/investment">INVESTMENT</a></li>
<li><a alt="SALES" href="/sales">SALES</a></li>
<li><a alt="PR" href="/pr">PR</a></li>
</ul>
</li>
<li><a alt="BLANC+EN?ENS INSTRUCTION" class="on" href="/instruction">BLANC+EN?ENS INSTRUCTION</a>
<ul class="hide sub first right list">
<li class="long2"><a alt="LEGAL TERMS" class="keep" href="/terms">LEGAL TERMS</a></li>
<li><a alt="IMPRINT" href="/imprint">IMPRINT</a></li>
<li><a alt="DOWNLOAD" href="/download">DOWNLOAD</a></li>
</ul>
</li>
<li><a alt="EFLè . FERDLè" href="/efleferdle">EFLè . FERDLè</a></li>
</ul>
<ul class="animate list">
<li><a alt="FASHION" href="/fashion">FASHION</a>
<ul class="hide sub fashion list">
<li><a alt="BROWNIE AND BLONDIE" href="/brownieandblondie">BROWNIE AND BLONDIE</a></li>
<li><a alt="DIETRICH EMTER" href="/dietrichemter">DIETRICH EMTER</a></li>
<li><a alt="LEVER COUTURE" href="/levercouture">LEVER COUTURE</a></li>
<li><a alt="OLIVER RUUGER" href="/oliverruuger">OLIVER RUUGER</a></li>
</ul>
</li>
<li><a alt="LUXURY" href="/luxury">LUXURY</a></li>
<li><a alt="ART" href="/art">ART</a></li>
</ul>
<ul class="animate list lower">
<li><a alt="INVESTORS" href="/investors">INVESTORS</a></li>
<li><a alt="NEWS" href="/news">NEWS</a></li>
<li><a alt="CONTACT" href="/contact">CONTACT</a></li>
</ul>
</div>
When I click once, the code works, after the second click, the .mouseenter
function with .animate()
and the .css()
does not work anymore, but the console.log()
runs. Why?
See it as example here: http://liebdich.biz/.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…