鼠标划过实现延迟加载并隐藏层的js代码

时间:2013-10-11    点击:79   
复制代码 代码如下:

<div id="follow">
<a href="#" onmouseover="showPlusMobile();" onmouseout="hidePlusMobile();" class="btn">+Follow</a>
<div class="layer_follow" id="layer_follow" onmouseover="showPlusMobile();" onmouseout="hidePlusMobile();">
<p>这是隐藏层</p>
</div>
</div>

css:
复制代码 代码如下:

.layer_follow
{
display:none
}

js:
复制代码 代码如下:

var isPlusMobileVisible=false;
var showTid;
var hideTid;
function showPlusMobile(){
if(isPlusMobileVisible == false) {
showTid = setTimeout("document.getElementById('layer_follow').style.display='block'; isPlusMobileVisible=true;", 500);
}else{
clearTimeout(hideTid);
}
}
function hidePlusMobile(){
if(isPlusMobileVisible == true) {
hideTid = setTimeout("document.getElementById('layer_follow').style.display='none'; isPlusMobileVisible=false;", 500);
}else {
clearTimeout(showTid);
}
}
extjs表格文本启用选择复制功能具体实现
JS验证身份证有效性示例
JS分页效果示例
appendChild() 或 insertBefore()使用与区别介绍
JQuery对class属性的操作实现按钮开关效果
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved