Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setTimeOut is Uncaught ReferenceError: setTimeOut is not defined [closed]

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 ....

like image 607
Aung Thet Avatar asked Mar 19 '14 03:03

Aung Thet


Video Answer


2 Answers

This is wrong: setTimeOut

Right word: setTimeout

(Change the O to lower case o)

like image 193
ShibinRagh Avatar answered Oct 02 '22 20:10

ShibinRagh


Change setTimeOut to setTimeout :

//...

setTimeout(
   function(){
      if(!$(this).next('div').is(':hover')){
         $(this).next('div').slideUp('slow');
      }}
   ,1000);

//...
like image 33
CarlosCarucce Avatar answered Oct 02 '22 20:10

CarlosCarucce