WEB开发网
开发学院网页设计JavaScript 从屏幕右下角自动上升的窗口的Javascript实现 阅读

从屏幕右下角自动上升的窗口的Javascript实现

 2010-09-14 13:30:48 来源:WEB开发网   
核心提示:////## FILE: dk_risingwindow.js//## CREATED: DannyKang @ 2004-4-1//## MODIFIED:DannyKang @ 2004-4-8//## FUNDESC: 右下角上升的窗口//function DK_MOVE_moveWindowUp() {DK_M

//########################################
//## FILE: dk_risingwindow.js
//## CREATED: DannyKang @ 2004-4-1
//## MODIFIED:DannyKang @ 2004-4-8
//## FUNDESC: 右下角上升的窗口
//########################################
function DK_MOVE_moveWindowUp() {
DK_MOVE_amount = parseInt((DK_MOVE_winHeight-DK_MOVE_total) * 0.2);
DK_MOVE_total += DK_MOVE_amount;
if(DK_MOVE_total
0) {
try {
window.moveBy(0, (-1) * DK_MOVE_amount);
}
catch(e){
}
}
else {
clearInterval(DK_MOVE_handle);
}
}
var DK_MOVE_amount=0;
var DK_MOVE_total=0;
var DK_MOVE_handle ;
var DK_MOVE_winHeight, DK_MOVE_winWidth;
//启动滚动窗口
function DK_MOVE_START(){
DK_MOVE_winHeight= document.body.offsetHeight + 30;
DK_MOVE_winWidth = document.body.offsetWidth + 10 ;
window.moveTo(window.screen.availWidth-DK_MOVE_winWidth, window.screen.availHeight);
DK_MOVE_handle = setInterval("DK_MOVE_moveWindowUp()",70);
}
document.body.oncontextmenu = new Function("return false;");
document.body.onselectstart = new Function("return false;");
document.body.onload = new Function("return DK_MOVE_START();");

/*调用方法*/

请在需要自动上升的页面内加入以下代码:

<script language=javascript src="index_js/dk_risingwindow.js"></script>

Tags:屏幕 右下角 自动

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接