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

时间:2010-04-19 17:15:31  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:####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<DK_MOVE_winHeight && DK_MOVE_amount>0) {  try {  window.moveBy(0, (-1) * DK_MOVE_amount);  }&nbs...
  正文:

//########################################
//## 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<DK_MOVE_winHeight && DK_MOVE_amount>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>

"从屏幕右下角自动上升的窗口的Javascript实现"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Programming/JavaScript/13707.html


关键字:

关于《从屏幕右下角自动上升的窗口的Javascript实现》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td