注意是用到了、下列的演示
<scriptlanguage = "javascript" type = "text/javascript">
ADTIME = 8;
chancead = 1;
varns =(document.layers);
varie =(document.all);
varw3 =(document.getElementById &&!ie);
adcount = 0;
functionItad(){
if(!ns &&!ie &&!w3)return;
if(ie)addiv = eval( 'document.all.sponsoraddiv.style');
elseif(ns)addiv = eval( 'document.layers ["sponsoraddiv"]');
elseif(w3)addiv = eval( 'document.getElementbyId( "sponsoraddiv")。style');
randad = math.ceil(math.random()*chancead);
if(ie || w3)
addiv.visibility = "visible";
それ以外
addiv.visibility = "show";
if(randad == 1)showad();
}
functionshowad(){
if(adcount <adtime*10){adcount+= 1;
if(ie){documentwidth = document.body.offsetwidth/2+document.body.scrollleft-20;
documentheight = document.body.offseetheight/2+document.body.scrolltop-20;}
elseif(ns){documentwidth = window.innerwidth/2+window.pagexoffset-20;
documentheight = window.innerheight/2+window.pageyoffset-20;}
elseif(w3){documentwidth = self.innerwidth/2+window.pagexoffset-20;
documentheight = self.innerheight/2+window.pageyoffset-20;}
addiv.left = documentwidth-100; addiv.top = documentheight-0;
setimeout( "showad()"、100);}
}
functionclosead(){
if(ie || w3)
addiv.display = "none";
それ以外
addiv.visibility = "hide";
}
function $(obj){
returnDocument.getElementById(OBJ);
}
functioncheckform(){
if($( "file1")。value!= "")
{
if(/jpg|jpeg|gif|bmp/i.test($( "file1")。value.match(//.(/ w+)$/)[0] == false){
アラート( "您只能上传图片文件");