电脑十万个为什么-第37章
按键盘上方向键 ← 或 → 可快速上下翻页,按键盘上的 Enter 键可回到本书目录页,按键盘上方向键 ↑ 可回到本页顶部!
————未阅读完?加入书签已便下次继续阅读!
move_function+=〃this。element = null;r〃;
move_function+=〃this。event = null;r〃;
move_function+=〃}r〃;
move_function+=〃var mouse = new mouseSTATUS();r〃;
move_function+=〃function actualizateMouseSTATUS(e) {r〃;
move_function+=〃if (!e) var e = eventr〃;
move_function+=〃if ((e。type=='mousedown' || e。type=='mouseup') && e。button!=1) return truer〃;
move_function+=〃var x=e。x+document。body。scrollLeftr〃;
move_function+=〃var y=e。y+document。body。scrollTopr〃;
move_function+=〃mouse。x=x;r〃;
move_function+=〃mouse。y=y;r〃;
move_function+=〃if (e。type=='mousedown') mouse。bt = 'down';r〃;
move_function+=〃else if(e。type=='mouseup') mouse。bt = 'up';r〃;
move_function+=〃if(window。event) {r〃;
move_function+=〃mouse。screenx=window。event。screenX;r〃;
move_function+=〃mouse。screeny=window。event。screenY;r〃;
move_function+=〃} else {r〃;
move_function+=〃mouse。screenx=0;r〃;
move_function+=〃mouse。screeny=0;r〃;
move_function+=〃}}r〃;
move_function+=〃function initMouseEvents() {r〃;
move_function+=〃document。onmousedown = actualizateMouseSTATUSr〃;
move_function+=〃document。onmousemove = actualizateMouseSTATUSr〃;
move_function+=〃document。onmouseup = actualizateMouseSTATUSr〃;
move_function+=〃document。onselectstart = selectstartr〃;
move_function+=〃document。ondragstart = new Function('actualizateMouseSTATUS(event); return false;')r〃;
move_function+=〃}r〃;
move_function+=〃function selectstart(){r〃;
move_function+=〃if ( event。srcElement。tagName != 'INPUT' && event。srcElement。tagName != 'TEXTAREA') { return false; } r〃;
move_function+=〃else { mouse。bt='up'; return true; }r〃;
move_function+=〃}r〃;
move_function+=〃initMouseEvents()r〃;
move_function+=〃var mywindowbt ='up';r〃;
move_function+=〃var wincloseSTATUS='up';r〃;
move_function+=〃var ofx=0;r〃;
move_function+=〃var ofy=0;r〃;
move_function+=〃var opx=0;r〃;
move_function+=〃var opy=0;r〃;
move_function+=〃var px=0;r〃;
move_function+=〃var py=0;r〃;
move_function+=〃var wclosechanged = false;r〃;
move_function+=〃function initToMoveWin() {r〃;
move_function+=〃if(mouse。y = 1 && mywindowbt == 'up' && mouse。bt =='up') { mywindowbt = 'over' }r〃;
move_function+=〃 else if (( mouse。y 》 22 || mouse。y 《 1 ) && mywindowbt == 'over' && mouse。bt =='up') { mywindowbt = 'up'}r〃;
move_function+=〃 else if (mouse。y =1 && mywindowbt == 'over' && mouse。bt == 'down' ) { r〃;
move_function+=〃self。window。focus();r〃;
move_function+=〃 ofx = mouse。x;r〃;
move_function+=〃 ofy = mouse。y;r〃;
move_function+=〃 opx = mouse。x;r〃;
move_function+=〃 opy = mouse。y;r〃;
move_function+=〃 mywindowbt='down';r〃;
move_function+=〃}r〃;
move_function+=〃 else if ( mouse。bt =='up' && mywindowbt == 'down' ) { 〃;
move_function+=〃 mywindowbt='up';〃;
move_function+=〃 ofx=0;〃;
move_function+=〃 ofy=0;〃;
move_function+=〃 opx=0; 〃;
move_function+=〃 opy=0;〃;
move_function+=〃 }〃;
move_function+=〃 else if ( mywindowbt == 'down' && wincloseSTATUS == 'up') {r〃;
move_function+=〃 var m_scrx = mouse。screenx;r〃;
move_function+=〃 var m_scry = mouse。screeny;r〃;
move_function+=〃 px = m_scrx … ofx;r〃;
move_function+=〃 py = m_scry … ofy;r〃;
move_function+=〃 top。window。moveTo(px;py);r〃;
move_function+=〃 }r〃;
move_function+=〃 setTimeout('initToMoveWin()';1);r〃;
move_function+=〃 }r〃;
move_function+=〃 initToMoveWin()r〃;
newWindow=window。open(〃〃;〃newWindow〃;〃fullscreen=1〃;〃width=〃+w+〃;height=〃+h);
newWindow。resizeTo(w;h);
newWindow。moveTo(x;y);
newWindow。document。open();
newWindow。document。write('');
newWindow。document。write('r');
newWindow。document。write('r');
newWindow。document。write('r');
newWindow。document。write('r');
newWindow。document。write('');
newWindow。document。write('');
newWindow。document。close();
newWindow。focus();
}
//……》