中文字幕第五页-中文字幕第页-中文字幕韩国-中文字幕最新-国产尤物二区三区在线观看-国产尤物福利视频一区二区

javascript中如何實現浮動窗口

小編給大家分享一下javascript中如何實現浮動窗口,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

網站設計制作過程拒絕使用模板建站;使用PHP+MYSQL原生開發可交付網站源代碼;符合網站優化排名的后臺管理系統;成都做網站、成都網站制作、成都外貿網站建設收費合理;免費進行網站備案等企業網站建設一條龍服務.我們是一家持續穩定運營了十余年的創新互聯網站建設公司。

javascript實現浮動窗口的方法:首先創建HTML文件;然后通過“function showFAd(){...}”方法打開浮動廣告;最后通過“function showFloat(){...}”方法實現打開浮動窗口即可。

本文操作環境:windows7系統、javascript1.8.5版、Dell G3電腦。

javascript怎么實現浮動窗口?

具體如下:

HTML部分:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
<style type="text/css">
*{ margin:0; padding:0;}
a img{ border:0;}
</style>
</head>
<body>
<div style="height:2000px; background:#ccc; display:none;">
</div>
<!--div id="floatAd" style=" position:fixed !important; position:absolute; _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight)); z-index: 2147483647; left: 50%; margin-left: -240px !important; top: 50%; margin-top: -210px !important; background:url(images/onlineSay.jpg) no-repeat; width:487px; height:350px; cursor:pointer;">
<div onclick="closeFAd();" style=" width:26px; height:26px; float:right;"></div>
<div style="width:487px; height:320px; float:right;" onclick="open_online();"></div>
</div>
<div id="floatSide" style=" width:141px; height:579px; position:fixed !important; position:absolute; _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight)); z-index: 99999; right:0; top:6%; background:url(images/onlineTel.gif);cursor:pointer;" onclick="open_online();></div-->
</body>
</html>
<script type="text/javascript" src="online.js"></script>

JS部分:

// JavaScript Document
//浮動廣告圖片
var floatAdImg = "images/onlineSay.jpg";
//浮動側欄圖片
var floatSideImg = "images/onlineTel.gif";
//打開在線溝通
function open_online()
{
 window.open('http://p.qiao.baidu.com//im/index?siteid=7342332&ucid=7601325');
}
//浮動廣告
document.writeln("<div id=\"floatAd\" style=\" position:fixed !important; position:absolute; _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight)); z-index: 2147483647; left: 50%; margin-left: -240px !important; top: 50%; margin-top: -210px !important; background:url("+floatAdImg+") no-repeat; width:487px; height:350px; cursor:pointer; display:none; \">");
document.writeln("<div onclick=\"closeFAd();\" style=\" width:26px; height:26px; float:right;\"></div>");
document.writeln("<div style=\"width:487px; height:320px; float:right;\" onclick=\"open_online();\"></div>");
document.writeln("</div>");
//浮動側欄
document.writeln("<div style=\" width:141px; height:579px; position:fixed !important; position:absolute; _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight)); z-index: 99999; right:0; top:6%; background:url("+floatSideImg+");cursor:pointer;\" onclick=\"open_online();\"></div>");
//關閉浮動廣告
function closeFAd()
{
 document.getElementById('floatAd').style.display = 'none';
}
//打開浮動廣告
function showFAd()
{
 document.getElementById('floatAd').style.display = 'block';
}
//打開浮動窗口
function showFloat()
{
 document.getElementById('floatAd').style.display = 'block';
}
//打開窗口 20 秒僅執行一次
setTimeout(showFAd,20000);
//每個 30 秒執行一次
setInterval(showFloat,30000);

以上是“javascript中如何實現浮動窗口”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注創新互聯行業資訊頻道!

本文標題:javascript中如何實現浮動窗口
網站URL:http://www.2m8n56k.cn/article32/ihgpsc.html

成都網站建設公司_創新互聯,為您提供網頁設計公司用戶體驗企業建站品牌網站建設微信小程序網站導航

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:[email protected]。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

手機網站建設
主站蜘蛛池模板: 成人a网站 | 在线欧洲成人免费视频 | 在线综合+亚洲+欧美中文字幕 | 国产成人最新毛片基地 | 国产成年视频 | 午夜在线播放免费人成无 | 天天看片日本 | 精品一区二区三区在线视频 | 日韩专区亚洲精品欧美专区 | 亚洲高清在线观看播放 | 一区视频| 久久99亚洲精品久久久久 | 欧美日韩亚洲国产精品 | 97免费公开视频 | 成年人在线看片 | 中文字幕波多野不卡一区 | 久精品在线观看 | 一区二区三区日韩 | 99免费在线观看 | 免费成人在线网站 | 欧美视频一区二区三区在线观看 | 一本久| 欧美二级在线观看免费 | 久久99久久精品视频 | 国产精品免费_区二区三区观看 | 步兵社区 | 欧美线在线精品观看视频 | 国内精品中文字幕 | 国产成人精品日本亚洲专 | 女人张开腿让男人捅的视频 | 日本人的色道免费网站 | 日本高清福利视频在线观看 | 久久免费在线视频 | 亚洲国产精品不卡毛片a在线 | 怡红院亚洲 | 亚洲国产综合人成综合网站00 | 亚欧成人毛片一区二区三区四区 | 日本不卡在线一区二区三区视频 | 欧美日韩亚洲高清不卡一区二区三区 | 看真人一一级毛片 | 亚洲精品一区二区三区四区 |