function addevent(obj,evttype,func,cap){ cap=cap||false; if(obj.addeventlistener){ obj.addeventlistener(evttype,func,cap); return true; }else if(obj.attachevent){ if(cap){ obj.setcapture(); return true; }else{ return obj.attachevent("on" + evttype,func); } }else{ return false; } } function getpagescroll(){ var xscroll,yscroll; if (self.pagexoffset) { xscroll = self.pagexoffset; } else if (document.documentelement && document.documentelement.scrollleft){ xscroll = document.documentelement.scrollleft; } else if (document.body) { xscroll = document.body.scrollleft; } if (self.pageyoffset) { yscroll = self.pageyoffset; } else if (document.documentelement && document.documentelement.scrolltop){ yscroll = document.documentelement.scrolltop; } else if (document.body) { yscroll = document.body.scrolltop; } arraypagescroll = new array(xscroll,yscroll); return arraypagescroll; } function getpagesize(){ var xscroll, yscroll; if (window.innerheight && window.scrollmaxy) { xscroll = document.body.scrollwidth; yscroll = window.innerheight + window.scrollmaxy; } else if (document.body.scrollheight > document.body.offsetheight){ xscroll = document.body.scrollwidth; yscroll = document.body.scrollheight; } else { xscroll = document.body.offsetwidth; yscroll = document.body.offsetheight; } var windowwidth, windowheight; if (self.innerheight) { windowwidth = self.innerwidth; windowheight = self.innerheight; } else if (document.documentelement && document.documentelement.clientheight) { windowwidth = document.documentelement.clientwidth; windowheight = document.documentelement.clientheight; } else if (document.body) { windowwidth = document.body.clientwidth; windowheight = document.body.clientheight; } if(yscroll < windowheight){ pageheight = windowheight; } else { pageheight = yscroll; } if(xscroll < windowwidth){ pagewidth = windowwidth; } else { pagewidth = xscroll; } arraypagesize = new array(pagewidth,pageheight,windowwidth,windowheight) return arraypagesize; } //广告脚本文件 admove.js /* 例子
***** content ******
var ad=new admove("div2"); ad.run(); */