1
boazleung
Challenging task - Floating Ads
  • 2006/2/8 12:55

  • boazleung

  • Just popping in

  • Posts: 14

  • Since: 2005/10/6


Dear all XOOPS professionals,

Is there anyone know how to add a floating ads like the following website:-

http://www.hiisp.com/index.php

I am not a programmer, please let me know the details procedure to add the code to; such as which folder, edit which file, etc.

Thanks a lot.

Boaz

2
jdseymour
Re: Challenging task - Floating Ads

Well the baby only seems to move around in Internet Explorer, It is there but does not move in Firefox. Which BTW the site looks much better in Firefox than in IE.

The code I found (viewing the page source) looks to be the one. I will copy it here:

<script language="JavaScript" src="MM_functions.js"></script>
<
script language="JavaScript">
<!--
P=new Image();
P.src="/images/baby.gif"
Pic=P.src;   
BY=-116;          
BX=-88;           
SY=3;             
SX=5;             
ns=(document.layers)?1:0;
if (
ns){
document.write("<LAYER NAME='netscape' LEFT=0 TOP=0><img src="+Pic+"></LAYER>");
}
else{
document.write("<div style='position:absolute;top:0px;left:0px'><div style='position:relative'>");
document.write("<a href='/order.html'><img id='explorer' border=0 src='"+Pic+"' style='position:absolute;top:0px;left:0px'></a>");
document.write("</div></div>")
}
R=0,PB=0,RD=0,Y=0,X=0,D=0,VB=0,HB=0;
Y=10;X=10;D=Math.floor(Math.random()*60+10);
function 
Curve(){
plusMinus=new Array(1,-1,2,-2,3,-3,0,1,-1)
R=Math.floor(Math.random()*plusMinus.length);
RD=plusMinus[R];

setTimeout('Curve()',1800);
}
function 
wenchin(){
setTimeout('wenchin()',70);
var 
H=(document.layers)?window.innerHeight:document.body.clientHeight;
var 
W=(document.layers)?window.innerWidth:document.body.clientWidth;
var 
YS=(document.layers)?window.pageYOffset:document.body.scrollTop;
var 
XS=(document.layers)?window.pageXOffset:document.body.scrollLeft;

PB=D+=RD;
SY*Math.sin(PB*Math.PI/180);
SX*Math.cos(PB*Math.PI/180);
if (
0D+=360;
Y+=y;
X+=x;
VB=180-D;
HB=0-D;
//Corner rebounds! not necessary but looks nice.
if ((1) && (1)) {Y=1;X=1;D=45;}
if ((
1) && (W+BX)) {Y=1;X=W+BX;D=135;}
if ((
H+BY) && (1)) {Y=H+BY;X=1;D=315;}
if ((
H+BY) && (W+BX)) {Y=H+BY;X=W+BX;D=225;}
//Edge rebounds!
if (1) {Y=1;D=HB;}  
if (
H+BY) {Y=H+BY;D=HB;}  
if (
1) {X=1;D=VB;} 
if (
W+BX) {X=W+BX;D=VB;} 
var 
layer=(document.layers)?document.netscape:explorer.style;
layer.top=Y+YS;
layer.left=X+XS;

}
function 
sTaRt(){Curve();wenchin()}
if (
document.all||document.layers){window.onload=sTaRt}
//-->
</script>


Like I said seems to only fully work with IE, Not firefox.

3
boazleung
Re: Challenging task - Floating Ads
  • 2006/2/8 13:15

  • boazleung

  • Just popping in

  • Posts: 14

  • Since: 2005/10/6


Thanks a lot.

Actually I also find the code yet, would u please let me know which file to be added to achieve the effect.

Boaz

Login

Who's Online

126 user(s) are online (86 user(s) are browsing Support Forums)


Members: 0


Guests: 126


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits