国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

鼠標劃過實現延遲加載并隱藏層的js代碼

2019-11-20 21:54:10
字體:
來源:轉載
供稿:網友
復制代碼 代碼如下:

<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);
}
}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 长乐市| 类乌齐县| 江山市| 郑州市| 聂荣县| 白玉县| 民县| 东丽区| 灵宝市| 邛崃市| 沂南县| 太康县| 济阳县| 龙井市| 肥西县| 衡阳市| 定安县| 铅山县| 龙门县| 仁布县| 吉木萨尔县| 镇平县| 红河县| 沭阳县| 呈贡县| 平谷区| 灵台县| 乾安县| 鹤庆县| 华池县| 睢宁县| 沾益县| 游戏| 民县| 武鸣县| 苏尼特左旗| 澄江县| 青田县| 乐亭县| 商都县| 呼和浩特市|