js效果问题,求大神解答
<li id="show" style="position:relative" ><a href="flow.php" target="_blank" rel="nofollow" class="J_header_cartCount" mars-send="m_shop_header_button_cart">购物袋</a><div id="showcart" style="display:none;"></div>
</li>
<script type="text/javascript">
var rp = document.getElementById("show");
var pp = document.getElementById('showcart');
rp.onmouseover = function(){
pp.style.display = "block";
clearTimeout(hide);
}
rp.onmouseout = function(){
var hide = window.setTimeout('close' , 1000);
}
function close(){
pp.style.display = "none";
}
</script>
我想做一个鼠标移进去显示方框,移出后过一秒后再隐藏方框,一秒内鼠标重新移进去就继续显示,可是做出来鼠标移出都没有效果,求求大神们解答解答~