First, I am new in javascript and I got a problem in setTimeOut ...
This is my script code........
$('#nav ul li a').hover(function(){
$(this).next("div").slideDown("fast").siblings("div").slideUp("slow");
console.log("hover");
},
function(){
setTimeOut(
function(){
if(!$(this).next('div').is(':hover')){
$(this).next('div').slideUp('slow');
}}
,1000)
});
This is my HTML Code.....
</div> <!-- end of first-row -->
<ul>
<li>
<a href="#">Home </a><div class="menu_box box1"></div>
</li>
<li>
<a href="#">Place</a><div class="menu_box box2"></div> <!-- end of menu -->
</li>
<li>
<a href="#">Guide</a><div class="menu_box box3"></div>
</li>
<li>
<a href="#">Contact</a>
</li>
<li>
<a href="#">About Us</a>
</li>
</ul>
</div> <!-- end of nav -->
Please guide me ....
This is wrong: setTimeOut
Right word: setTimeout
(Change the O to lower case o)
Change setTimeOut to setTimeout :
//...
setTimeout(
function(){
if(!$(this).next('div').is(':hover')){
$(this).next('div').slideUp('slow');
}}
,1000);
//...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With