[转]页面外仿 MSN 弹出提示信息的脚本改进版(仅能在IE下运行!)
Code
<SCRIPT>
var oPopup;
try {
oPopup = window.createPopup();
} catch (e) {
window.status = '弹出通知消息仅能用于 IE 下 ! ';
}
var popTop = 10 ;
var mytime;
function popmsg(msgstr){
if ( ! oPopup) {
return ;
}
oPopup.document.body.innerHTML = msgstr;
popshow();
}
function popshow(){
// window.status=popTop;
if (popTop > 1720 ){
clearTimeout(mytime);
oPopup.hide();
return ;
} else if (popTop >= 1720 - 108 && popTop <= 1720 ){
oPopup.show(screen.width - 200 ,screen.height, 193 , 1720 - popTop);
} else if (popTop >= 1500 && popTop < 1720 - 108 ){
oPopup.show(screen.width - 200 , screen.height - 220 + (popTop - 1500 ), 193 , 108 );
} else if (popTop <= 108 ){
oPopup.show(screen.width - 200 , screen.height, 193 , popTop);
}
else if (popTop <= 220 ){
oPopup.show(screen.width - 200 , screen.height - popTop, 193 , 108 );
} else {
// window.status=popTop + " else";
oPopup.show(screen.width - 200 , screen.height - 220 , 193 , 108 );
}
popTop += 10 ;
mytime = setTimeout( " popshow(); " , 40 );
}
function hidePop() {
clearTimeout(mytime);
oPopup.hide();
}
popmsg( " <div onclick='window.parent.hidePop()' title='点击隐藏' style='cursor:pointer; background-image: url(http://www.blogjava.net/images/blogjava_net/beansoft/18269/o_qqbg.gif); width:193; height:108; color:white; padding-top:1em; padding-left:5; font-size:11pt; color:white' ><center><b>BlogJava 系统消息<br><br>请留言或者捐款支持 BeanSoft 的 Java EE 学习视频, 谢谢 !!</b></center></div> " );
</SCRIPT>
<SCRIPT>
var oPopup;
try {
oPopup = window.createPopup();
} catch (e) {
window.status = '弹出通知消息仅能用于 IE 下 ! ';
}
var popTop = 10 ;
var mytime;
function popmsg(msgstr){
if ( ! oPopup) {
return ;
}
oPopup.document.body.innerHTML = msgstr;
popshow();
}
function popshow(){
// window.status=popTop;
if (popTop > 1720 ){
clearTimeout(mytime);
oPopup.hide();
return ;
} else if (popTop >= 1720 - 108 && popTop <= 1720 ){
oPopup.show(screen.width - 200 ,screen.height, 193 , 1720 - popTop);
} else if (popTop >= 1500 && popTop < 1720 - 108 ){
oPopup.show(screen.width - 200 , screen.height - 220 + (popTop - 1500 ), 193 , 108 );
} else if (popTop <= 108 ){
oPopup.show(screen.width - 200 , screen.height, 193 , popTop);
}
else if (popTop <= 220 ){
oPopup.show(screen.width - 200 , screen.height - popTop, 193 , 108 );
} else {
// window.status=popTop + " else";
oPopup.show(screen.width - 200 , screen.height - 220 , 193 , 108 );
}
popTop += 10 ;
mytime = setTimeout( " popshow(); " , 40 );
}
function hidePop() {
clearTimeout(mytime);
oPopup.hide();
}
popmsg( " <div onclick='window.parent.hidePop()' title='点击隐藏' style='cursor:pointer; background-image: url(http://www.blogjava.net/images/blogjava_net/beansoft/18269/o_qqbg.gif); width:193; height:108; color:white; padding-top:1em; padding-left:5; font-size:11pt; color:white' ><center><b>BlogJava 系统消息<br><br>请留言或者捐款支持 BeanSoft 的 Java EE 学习视频, 谢谢 !!</b></center></div> " );
</SCRIPT>
posted on 2008-12-29 14:54 freeliver54 阅读(470) 评论(2) 编辑 收藏 举报