我正在尝试使我的应用程序的上面板具有默认top属性,-80px因此除了其中的一小部分之外它是不可见的。当用户将鼠标悬停在该部分上时,它会再次向下滑动。
问题是,这个 div 有一个textbox,我希望 div 在用户输入时停止向上滑动,textbox即使他将鼠标指针移开,但不幸的是不知道如何做到这一点,这是我的代码:
索引.html
<div id="taskInput">
    <div id="controllers">
         <input type="text" name="mainTask" id="mainTask">
         <button id="addMain">Add</button>
         <button id="resetMain">Reset</button>
    </div>       
</div>
这部分的CSS:
#taskInput {
    background: red;
    width:606px;
    height:43px;    
    padding: 22px;    
    box-shadow: 0px 3px 4px -3px black;
    position: absolute;    
    z-index : 0;
    top:0px;
}
脚本.js
$(function(){
    $("#taskInput").delay(400).animate({top:-80}, 500,function(){});
    $("#taskInput").mouseover(
        function(){
            $(this).stop().animate({top:0}, 200, function(){});            
        });
    $("#taskInput").mouseout(function(evt){                    
        $(this).stop().animate({top:-80}, 200, function(){});           
    })
    $("#mainTask").focus(function(){
        //i though i can put something here to stop mouseout event or something
    })
})