javascript 弹出窗口问题,高手帮忙解释一下各个语句的含义
<SCRIPT>
var oPopup = window.createPopup();
var popTop=50;
function popmsg(msgstr){
var winstr= " ";
winstr+= " ";
winstr+= " <h2 style=\ "color:#000;font-size:12px;line-height:20px;width:auto;height:229px;margin:0;padding:40px 10px 10px 10px;background:#f5f5f5;border:1px #000 solid;\ "> "+msgstr+ " </h2> ";
oPopup.document.body.innerHTML = winstr;
popshow();
}
function popshow(){
window.status=popTop;
if(popTop> 1720){
clearTimeout(mytime);
oPopup.hide();
return;
}else if(popTop> 1520&&popTop <1720){
oPopup.show(screen.width-250,screen.height,241,1720-popTop);
}else if(popTop> 1500&&popTop <1520){
oPopup.show(screen.width-250,screen.height+(popTop-1720),241,172);
}else if(popTop <180){
oPopup.show(screen.width-250,screen.height,241,popTop);
}else if(popTop <220){
oPopup.show(screen.width-250,screen.height-popTop,241,172);
}
popTop+=10;
var mytime=setTimeout( "popshow(); ",50);
}
popmsg( "欢迎光临1NetMedia 'S Blog "); </SCRIPT>
------解决方案--------------------Java和javascript是两回事,所以即使你精通java,javascript不会也是有可能的。
上面的语句看上去都不麻烦,即使看不懂,也比较容易猜。楼主可以找本javascipt的参考书看,网上也有电子版的。
------解决方案--------------------定时弹出窗口,时间在1720后就自动隐藏,popTop用来计数,窗口在50毫秒后显示,同时在状态栏显示计时器。。。winstr是窗口的大小等属性设置。。。这家伙又在oPopup.show里重新设了大小。