Hi,
This is my first attempt to post here. I have problem getting this code working inside the swiki. The best way to see how it's supposed to work is to make a something.html file and then test it. The small box should stay in the corner, visible, the whole time. When I add it to my Swiki something else happens...
 
<!-- saved from url="" -->
<html>
 
<Script>
 

floatX=10;
floatY=10;
layerwidth=70;
layerheight=50;
delayspeed=3;
 
var IE=(document.all);
var NS5up=((navigator.userAgent.toLowerCase().indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=5));
var NS4=(document.layers);
var Hide=(IE)?"none":"hidden";
var Show=(IE)?"block":"visible";
 
var scrollLeft=  (IE)?"document.body.scrollLeft":"window.pageXOffset";
var scrollTop=  (IE)?"document.body.scrollTop":"window.pageYOffset";
var offsetWidth= (IE)?"document.body.offsetWidth":"window.innerWidth";
var offsetHeight= (IE)?"document.body.offsetHeight":"window.innerHeight";
 
 
 
function show_hide_remote (layer, visible){
 var thisLayer=(IE)?eval("window.opener.document.all('"+layer+"')"):eval("document."+layer);
  thisLayer=(NS5up)?eval("window.opener.document.getElementById('"+layer+"')"):thisLayer;
 if(NS4 && thisLayer) thisLayer.visibility = (visible) ? Show:Hide;
 if(IE && thisLayer) thisLayer.style.display = (visible) ? Show:Hide;
 if(NS5up && thisLayer) thisLayer.style.visibility = (visible) ? Show:Hide;
}
 
function adjust(layer) {
 
 var thisLayer=(IE)?eval("document.all('"+layer+"')"):eval("document."+layer);
  thisLayer=(NS5up)?eval("document.getElementById('"+layer+"')"):thisLayer;
 if (prevX==-1 || delayspeed==0)
 {
  prevX=eval(scrollLeft) + floatX;
  prevY=eval(scrollTop) + floatY;
 }
 
 else
 
 {
  dx=Math.abs(eval(scrollLeft)+floatX-prevX);
  dy=Math.abs(eval(scrollTop)+floatY-prevY);
  d=Math.sqrt(dx*dx+dy*dy);
  c=Math.round(d/10);
  if (eval(scrollLeft) + floatX > prevX ) {prevX = prevX + delayspeed + c;}
  if (eval(scrollLeft) + floatX < prevX ) {prevX = prevX - delayspeed - c;}
  if (eval(scrollTop)  + floatY > prevY ) {prevY = prevY + delayspeed + c;}
  if (eval(scrollTop)  + floatY < prevY ) {prevY = prevY - delayspeed - c;}
 }
 
 if (NS5up){ thisLayer.style.left = prevX; thisLayer.style.top=prevY;}
 if (NS4){thisLayer.pageX = prevX; thisLayer.pageY = prevY;}
 if (IE) {thisLayer.style.posLeft = prevX; thisLayer.style.posTop = prevY;}
 
setTimeout('adjust("'+layer+'")',50);
 
}
 
function define()
{
  floatX=eval(offsetWidth)-ifloatX-layerwidth-20
  floatY=eval(offsetHeight)-ifloatY-layerheight
}
 
 
 
 
 
</Script>
 
 
 

<body  vlink="#172DA5" alink="#172DA5" link="#172DA5" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" style="margin:0px">
 
 
 

<script>
 
function closeRating() {
 show_hide_rating("floatlayer", 0)
 var expdate = new Date ();
    expdate.setTime (expdate.getTime() + (1000 * 60 * 60 * 24 * 1));
    setCookie ("closerating", "1", expdate);
}
 
function windowOpener(url, windowname, width, height){
 
 window.name = "casetem";
 
 screenWidth = screen.width ;
 screenHeight = screen.height;
 windowWidth = width;
 windowHeight = height;
 
 xCoOrd = (screenWidth/2 - windowWidth/2);
 yCoOrd = (screenHeight/2 - windowHeight/2);
 
 window.open(url, windowname ,'toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,left='+xCoOrd+',top='+yCoOrd+',width='+windowWidth+',height='+windowHeight);
 
}
 
if (NS4) { 
 document.write('<LAYER NAME="floatlayer" LEFT="'+floatX+'" TOP="'+floatY+'" >');
}
if ((IE) || (NS5up)) {
 document.write('<div id="floatlayer" style="position:absolute; left:'+floatX+'; top:'+floatY+'; ">');
}
 
</script>
 
 
 
<table cellspacing="0" cellpadding="0" border="0" width="30">
<tr>
    <td align="right"><a href="" ><img src="" width="11" height="12" alt="" border="0"></a></td>
 
</tr>
<tr>
    <td align="center"><A HREF=""  >
 <img src="" width="27" height="24" alt="" border="0"></A></td>
</tr>
<tr>
    <td align="center">RATING</td>
</tr>
</table>
 
 
 
<script>
if (NS4) {
 document.write('</LAYER>');
}
if ((IE) || (NS5up))  {
 document.write('</DIV>');
}
 
ifloatX=floatX;
ifloatY=floatY;
define();
window.>prevX=-1;
prevY=-1;
adjust("floatlayer");
 
rated = getCookie("caseID15980")
ratingClosed = getCookie("closerating")
 
if (!rated && !ratingClosed){
 show_hide_rating("floatlayer", 1)
}
else {
 show_hide_rating("floatlayer", 0)
}
 
</script>
 

</html>
_______________________________________________
Pws mailing list
[EMAIL PROTECTED]
https://mailman.cc.gatech.edu/mailman/listinfo/pws

Reply via email to