metanohi-misc-subsites/old-projects/x/windows.htm

199 lines
3.5 KiB
HTML
Raw Normal View History

2011-08-02 19:57:57 +02:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml">
<head>
<title>Windows</title>
<style type='text/css'>
* {
margin:0;
padding:0;
text-decoration:none;
}
body {
background-color:#000;
overflow:hidden;
}
div {
position:absolute;
background:#000 url('img/top.png') repeat-x;
visibility:hidden;
}
#selected {
background:#000 url('img/topselected.png') repeat-x;
/*z-index:1;*/
}
div p {
color:#444;
font:12px tahoma;
padding:0 2px 0 2px;
height:15px;
cursor:default;
}
#selected p {
color:#000;
}
div div {
visibility:visible;
font:12px tahoma;
position:relative;
background:#000;
border-width:0 1px 1px 1px;
border-style:solid;
border-color:#b3b3b3;
padding:3px;
color:#555;
}
#selected div {
color:#fff;
border-color:#7a7a7a;
}
</style>
<script type='text/javascript'>
selected=false
x=0
y=0
nn=0
index=3
function boxpos() {
ww=document.getElementById("selected")
offl=ww.offsetLeft
offt=ww.offsetTop
t=setTimeout("boxpos()",50)
}
function adjust() {
bn=document.body
if (self.innerHeight) {
w=self.innerWidth
h=self.innerHeight
}
else if (document.documentElement && document.documentElement.clientHeight) {
w=document.documentElement.clientWidth
h=document.documentElement.clientHeight
}
else if (document.body) {
w=document.body.clientWidth
h=document.body.clientHeight
}
for (i=0;i<bn.childNodes.length;i++) {
node=bn.childNodes[i]
if (node.nodeName=="DIV") {
node.style.left=w/2-node.scrollWidth/2+"px"
node.style.top=h/2-node.scrollHeight/2+"px"
node.style.visibility="visible"
}
}
//boxpos()
}
function mdown(num) {
c=0
bn=document.body
for (i=0;i<bn.childNodes.length;i++) {
node=bn.childNodes[i]
if (node.nodeName=="DIV") {
if (c==num) {
node.id="select"
node.style.zIndex=index
}
else {
node.id=""
}
c=c+1
}
}
document.getElementById("select").id="selected"
offl=document.getElementById("selected").offsetLeft
offt=document.getElementById("selected").offsetTop
xcoor=x-offl
ycoor=y-offt
xm=xcoor
ym=ycoor
selected=true
}
function mup() {
selected=false
index+=1
}
function movewindow(event) {
x=event.pageX
y=event.pageY
//document.title=nn
ww=document.getElementById("selected")
/*
c=0
bn=document.body
for (i=0;i<bn.childNodes.length;i++) {
node=bn.childNodes[i]
if (node.nodeName=="DIV") {
if (c==nn) {
ww=node
}
c=c+1
}
}
*/
offl=ww.offsetLeft
offt=ww.offsetTop
//document.title=offl
xcoor=x-offl
ycoor=y-offt
if (selected) {
ww.style.left=x-xm+"px"
ww.style.top=y-ym+"px"
}
}
window.onload=adjust
document.onmousemove=movewindow
</script>
</head>
<body>
<div>
<p onmousedown='mdown(0)' onmouseup='mup()' style='z-index: 1'>A third window</p>
<div>
This is a third window.
</div>
</div>
<div>
<p onmousedown='mdown(1)' onmouseup='mup()' style='z-index: 2'>Another window</p>
<div>
This is also a window.
</div>
</div>
<div id='selected'>
<p onmousedown='mdown(2)' onmouseup='mup()' style='z-index: 3'>A window</p>
<div>
This is a window.
<!--<object data='http://www.cartoonsfree.tv/unicast_mov/AFTVCartoonsH2641000.mov' type='video/quicktime' style='width:768px;height:592px'>
<param name="src" value="http://www.cartoonsfree.tv/unicast_mov/AFTVCartoonsH2641000.mov">
<param name="autoplay" value="true">
<param name="autoStart" value="1">
</object>-->
</div>
</div>
</body>
</html>