В этой статье описывается простая реализация эффектов плавучих окон от JS. Поделитесь этим для вашей ссылки, следующим образом:
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> unt witch witch witch </title> <style type = "text/css">*{margin: 0; Подкладка: 0;} a img {border: 0;} </style> </head> <body> <div style = "height: 2000px; фон: #ccc; отображение: нет;"> </div> <!-div id = "float style =" Положение: фиксировано! Важно; позиция: абсолют; _top: Expression (Document.documentelement.scrolltop+Document.documentelement.ClientHeight-This.Offsetheight); без переоборудования; style = "width: 26px; высота: 26px; float: right;"> </div> <div onclick = "open_online ();"> </div> </div> <div id = "floatside" style = "width: 141px; высота: 579px; положение: фиксированное! Важно; _top: Expression (document.documentelement.scrolltop+document.documentelement.clientHeight-this.Offsetheight); onclick = "open_online ();> </div-> </body> </html> <script type =" text/javascript "src =" online.js "> </script>JS Часть:
// javascript Document // Плавающее рекламное изображение var floatadimg = "Images/onlinesay.jpg"; // Плавающее изображение с боковой панель window.open ('http://p.qiao.baidu.com//im/index?siteid=7342332&ucid=7601325');} // плавающее рекламное документ. _top: Expression (Document.documentelement.scrolltop+Document.documentelement.ClientHeight-Theis.Offsetheight); Нет, ширина: 487px; style =/"width: 487px; высота: 320px; float: right;/" onclick =/"open_online ();/"> </div> "); document.writeln (" </div> "); // плавающая боковая панель документ. _Top: Expression (Document.Documentelement.scrolltop+Document.documentelement.clientHeight-This.Offsetheight); Функция рекламы плавающей рекламы closeFad () {document.getElementById ('floatad'). style.display = 'none';} // open ploat ad function showfad () {document.getElementById ('floatAd'). style.display = 'block';} // open ploating window function showfloat () {document.getElementBeamid ('floatd'). 'block';} // Открыть функцию окна showfloat () {document.getElementById ('floatAd'). style.disploat = 'block';} // Открыть окно в течение 20 секунд и только выполнять SetTimeout один раз (ShowFad, 20000); // open setInterval (showfloat, 30000);Рендеринги следующие:
For more information about JavaScript related content, please check out the topics of this site: "Summary of JavaScript Traversal Algorithm and Skills", "Summary of JavaScript Switching Special Effects and Skills", "Summary of JavaScript Search Algorithm Skills", "Summary of JavaScript Animation Special Effects and Skills", "Summary of JavaScript Errors and Debugging Skills", "Summary of JavaScript Data Structures и навыки алгоритма »и« Сводка использования математической операции JavaScript »»
Я надеюсь, что эта статья будет полезна для каждого программирования JavaScript.