JS crée des effets spéciaux publicitaires sur la gauche et la droite des pages Web.
Citation:
La copie de code est la suivante:
<script src = "js / ad.js" type = "text / javascript"> </ script>
2. Appel de page
<! 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" Lang = "ZH-CN"> <A-Head> <Meta Http-Equiv = "Content-Type" Content = "Text / Html; Charset = UTF-8" /> <Title> JS Crée des effets AD pour les gauchers et les droits Floating Web pages_www.vevb.com </title> <style> Body {Font-Family: Arial, Helvetica, Sans-Serif, "安体"; taille de police: 12px; Hauteur: 2000px; Couleur: # 667382} * {rembourrage: 0px; marge: 0px;} ul {marge: 0px; padding: 0px;} li {list-style-type: Aucun; margin: 0px; padding: 0px;}. fl {float: gauche;}. fr {float: droite;}. cl {clairement: à la fois;}. 0px; marge-left: auto;}. tc {text-align: Center;}. JIAC {Font-Weight: Bold;}. Cur {Cursor: Pointer;} img {border: 0px;} </ style> </ head> <body> <script src = "js / ad.js" type = "text / javascript"3. JS Code publicitaire suspendu ad.js
Var Browser = {ie6: function () {return ((window.xmlhttprequest == Undefined) && (activeXObject! = Undefined))}, getWindow: function () {var myHeight = 0; var; myWidth = 0; if (typeof (window.innerwidth) == 'nombre') {myheight = window.innerHeight; myWidth = window.innerwidth} else if (document.documentElement) {myHeight = document.DocumentElement.ClientHeight; MyWidth = document.DocumentElement.Clientwidth} else; if (document.body) {myheight = document.body.clientHeight; myWidth = document.body.clientWidth} return {'height': myheight, 'width': myWidth}}, getCroll: function () {var myheight = 0; var; myWidth = 0; if (typeof (window.pageyoffset) == 'nombre') {myheight = window.pageyoffset; myWidth = window.pagexoffset} else if (document.documentElement) {myHeight = document.DocumentElement.Scrolltop; myWidth = document.DocumentElement.scrollleft} else if (document.body) {myheight = document.body.scrolltop; myWidth = document.body.scrollleft} return {'height': myheight, 'width': mywidth}}, getDocwidth: function (d) {if (! d) var d = document; return; Math.max (math.max (d.body.scrollwidth, d.documentElement.scrollWidth), math.max (d.body.offsetwidth, D.DocumentElement.offsetWidth), math.max (d.body.clientwidth, d.DocumentElement.ClientWidth)}, GetDoCHEIGH Math.max (math.max (d.body.scrollHeight, D.DocumentElement.ScrollHeight), Math.max (D.Body.offsetheight, D.DocumentElement.offsetheight), math.max (D.Body.ClientHeight, D.DocumentElement.ClientHeight))}}; type = typeof (id); if (type == 'objet') return id; if (type == 'string') return document.getElementById (id); return null}, inserthtml: function (html) {var frag = document.CreateDocumentFragment (); var div = document.CreateElement ("div"); div. i = 0, ii = div.childnodes.length; i <ii; i ++) {frag.appendChild (div.childnodes [i])} document.body.insertbefore (frag, document.body.firstchild) {var var ele = dom.id (élément); if (! ele) return; if (ele.addeventListener) ele.addeventListener (type, handler, false); else if (ele.attachevent) ele.attachevent ("on" + type, mannequin); ele ele ["on" + type] = handler}, retire: function (élément, type, handler) {vars ele = dom.id (élément); if (! ele) return; if (ele.removeeventListener) ele.reMoveEventListener (type, gestionnaire, false); else if (ele.detachevent) ele.detachevent ("sur" + type, handler); ele ele ["sur" + type] = null}}; var position id = dom.id (id); var ie6 = Browser.ie6 (); var win = Browser.getWindow (); var ele = {'height': id.clientheight, 'width': id.clientwidth}; if (ie6) {var scrollbar = Browser.getscroll ()} else {var Scrollbar = {'Height': 0, 'Width': 0}; id.style.position = 'fixe'} ele.top = parseInt ((win.height-ele.height) /2+scrollbar.h huit); id.style.top = ele.top + 'px'; id.style.right = '3px'}, florightcenter: function (id) {position.RightCenter (id); fun = function () {position.RightCenter (id)}; if (Browser.ie6 ()) {MyEvent.add (Window, 'Scroll', Fun); MyEvent.Add (Window, 'Resize', Fun)} Else {MyEvent.Add (Window ie6 = Browser.ie6 (); var win = Browser.getWindow (); var ele = {'height': id.clientheight, 'width': id.clientwidth}; if (ie6) {var scrollbar = Browser.getscroll ()} else {var scrollbar = {'height': 0, 'width': 0}; id.style.position = 'fixe'} ele.top = parseInt (win.height-ele.height) / 2 + scrollbar .Height); id.style.top = ele.top + 'px'; id.style.left = '3px'}, floatleftcenter: function (id) {position.leftCenter (id); var fun = function () {position.leftCenter (id)}; if (Browser.ie6 ()) {MyEvent.add (Window, 'Scroll', Fun); MyEvent.add (Window, 'redimensi', Fun)} else {MyEvent.Add (Window, 'Resize', Fun)}}}; fonction ad_left () {var html; html = '<div id = "ad_left" style = "position: absolu; largeur: 130px; hauteur: 300px; z-index: 10001"> <a style = "position: absolu; top: -15px; gauche: 0;" href = "JavaScript: void (0);" onclick = "document.getElementById (/ 'ad_left /'). style.display = / 'non /'"> close </a> <a href = "http://www.plchome.org"> <img src = "images / ad.jpg" /> </a> </ div> '; dom.inserthtml (html); position.floatleftCenter ('ad_left');} fonction ad_right () {var html; html = '<div id = "ad_right" style = "position: absolu; largeur: 130px; hauteur: 300px; z-index: 10001"> <a style = "position: absolu; top: -15px; droit: 0;" href = "JavaScript: void (0);" onClick = "document.getElementById (/ 'ad_right /'). style.display = / 'non /'"> close </a> <a href = "// www.vevb.com"> <img src = "images / ad.jpg" /> </a> </ div> '; dom.inserthtml (html); position.floatrightcenter ('ad_right');} myevent.add (fenêtre, 'charge', ad_left); myevent.add (fenêtre, 'chargé', ad_right);Finition.