يقوم JS بإنشاء مؤثرات خاصة إعلانية على اليسار واليمين من صفحات الويب.
يقتبس:
نسخة الكود كما يلي:
<script src = "js/ad.js" type = "text/javaScript"> </script>
2. استدعاء الصفحة
<! doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3 xmlns = "http://www.w3.org/1999/xhtml pages_www.vevb.com </title> <style> body {font-family: arial ، helvetica ، sans-serif ، "安体" ؛ حجم الخط: 12 بكسل ؛ الارتفاع: 2000 بكسل ؛ اللون:#667382}*{padding: 0px ؛ الهامش: 0px ؛} ul {margin: 0px ؛ padding: 0px ؛} li {list-style-type: none ؛ margin: 0px ؛ padding: 0px ؛}. fl {float: left ؛}. 0px ؛ Margin-Left: Auto ؛}. tc {text-align: center ؛}. type = "text/javaScript"> </script> </body> </html>3. JS مع وقف التنفيذ رمز الإعلان
var browser = {ie6: function () {return ((window.xmlHttpRequest == undefined) && (ActivexObject! = undefined))} ، getWindow: function () {var myheight = 0 ؛ var myWidth = 0 ؛ if (typeof (window.innerwidth) == 'number') {myheight = window.innerheight ؛ mywidth = window.innerwidth} else else (document.documentElement) {myheight = document.documentElement.clientheight ؛ myWidth = document.documentElement.clientEtTherTh} آخر if (document.body) {myheight = document.body.clientheight ؛ myWidth = document.body.clientwidth} return {'height': myheight ، 'width': mywidth}} ، getScroll: function () {var myheight = 0 ؛ var myWidth = 0 ؛ if (typeof (window.pageyoffset) == 'number') {myheight = window.pageyoffset ؛ myWidth = window.pagexoffset} آخر إذا (document.documentElement) {myheight = document.documentElement.scrolltop ؛ myWidth = document.documentElement.Scrollement 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))) 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 == 'Object') repurn id ؛ if (type == 'string') return document.getElementById (id) ؛ return null} ، inserthtml: function (html) i = 0 ، ii = div.childnodes.length ؛ i <ii ؛ i ++) {frag.appendChild (div.childnodes [i])} document.OnderBefore (frag ، document.body.firstchild)}} ؛ var myevent = {add: element ، type) {var eLe = dom.id (element) ؛ if (! ele) return ؛ if (ele.addeventListener) ele.addeventListener (type ، handler ، false) ؛ else elf (ele.attachevent) ele.attachevent ("on"+type ، handler) ؛ ele ele ["on"+type] = handler} ، ele = dom.id (element) ؛ if (! ele) return ؛ if (ele.RemoveEventListener) ele.RemoveEventListener (type ، handler ، false) ؛ id = dom.id (id) ؛ var ie6 = browser.ie6 () ؛ var win = browser.getwindow () ؛ var ele = {'height' scrollbar = {'height': 0 ، 'width': 0} ؛ id.style.position = 'fixed'} ele.top = parseint ((win.height-ele.height)/2+scrollbar.h ثمانية) ؛ id.style.top = ele.top+'px' ؛ id.style.right = '3px'} ، floatrightcenter: function (id) {position.RightCenter (id) ؛ var fun = function () {position.RightCenter (id)} ؛ if (browser.ie6 ()) {myevent.add (window ، 'scroll' ، fun) ؛ myevent.add (window ، 'reals' ، fun)} else {myevent.add (window ، 'resize' ،}}}} ، function (id) {var) ie6 = browser.ie6 () ؛ var win = browser.getWindow () ؛ var eLe = {'height': id.clientheight ، 'width': id.clientwidth} ؛ if (ie6) {var scrollbar = browser.getscroll ()} {var scrollbar = {'height': 0 ، 'width': 0} ؛ id.style.position = 'fixed'} ele.top = parseint ((win.height-ele.height)/2+scrollbar .hight) ؛ 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 ، 'regline' ، fun)} ell {myevent.add (window ، 'resize' ،}}}}} html = '<div id = "ad_left" style = "الموضع: المطلق ؛ العرض: 130px ؛ الارتفاع: 300px ؛ z-index: 10001"> <a style = "الموضع: المطلق ؛ أعلى: -15px ؛ اليسار: 0 ؛" HREF = "JavaScript: void (0) ؛" onClick = "document.getElementById (/'ad_left/'). style.display =/'none/'"> inting </a> <a href = "http://www.plchome.org"> <img src = "images/ad.jpg"/> </a> </viv> '؛ dom.inserthtml (html) ؛ position.floatleftCenter ('ad_left') ؛} الدالة ad_right () {var html ؛ html = '<div id = "ad_right" style = "الموضع: المطلق ؛ العرض: 130px ؛ الارتفاع: 300px ؛ z-index: 10001"> <a style = "الموضع: المطلق ؛ أعلى: -15px ؛ يمين: 0 ؛" HREF = "JavaScript: void (0) ؛" onClick = "document.getElementById (/'ad_right/'). style.display =/'none/'"> elling </a> <a href = "// www.vevb.com"> <img src = "images/ad.jpg"/> </af> </div> ؛ dom.inserthtml (html) ؛ position.floatrightCenter ('ad_right') ؛} myevent.add (window ، 'load' ، ad_left) ؛ myevent.add (window ، 'load' ، ad_right) ؛ينهي.