質問

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);

//...
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top