User:Jonnylinuxnerd/monobook.js

This is an old revision of this page, as edited by Jonnylinuxnerd (talk | contribs) at 22:05, 2 November 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
<!--/*offsetX=150
offsetY=20

windowX=10
windowY=10

moveAllowed=false

document.onMouseMove=function mouseMove(theEvent){
if (document.all){
mouseX=theEvent.x
mouseY=theEvent.y
}
else
{
mouseX=theEvent.pageX
mouseY=theEvent.pageY
}
if (moveAllowed==true){
moveWindow()
}
}

function calcOffset(){
offsetX=windowX-mouseX
offsetY=windowY-mouseY
}


function moveWindow(){
windowX=mouseX+offsetX
windowY=mouseY+offsetY
var window=document.getElementById("window")
window.style.left=windowX
window.style.top=windowY
}


document.write('<div id="window" style="position:absolute;top:20px;right:10px;background-color:lightgreen;width:250px;height:400px;z-index:9;opacity:0.6;text-align:center;cursor:move;" onMouseDown="moveAllowed=true;calcOffset()" onMouseUp="moveAllowed=false"><div style="font-size:24pt;"><b><u>Jot-pad</u></b></div><textarea rows="21"></textarea></div>');*/-->