TechMates
member?
If not be one of us!Join us guys!
Login if your a member!
Enjoy!

TechMates

Life is Useless without TechMates
 
HomePortalCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 Floating objects II (up down effects)

Go down 
AuthorMessage
JorgyRom
Admin
Admin
avatar

Posts : 49
Points : 78
Reputation : 3
Join date : 2009-07-26
Age : 26
Location : Manila

PostSubject: Floating objects II (up down effects)   Fri Jul 31, 2009 2:27 am

Description:
Floating Images II animates any image (or block of HTML) up and down the browser window, like an elevator, and stays in view even if the user scrolls the page. Going up anyone?


Code: edit the red bold part..
Quote :
adnpht="
";

flow=document.getElementById('flo_wrapper');
river=document.createElement("div");
river.innerHTML=adnpht;
flow.parentNode.insertBefore(river,flow);

var XX=20;
var xstep=1;
var delay_time=60;

var YY=0;
var ch=0;
var oh=0;
var yon=0;

var ns4=document.layers?1:0
var ie=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0

if(ie){
YY=document.body.clientHeight;
point1.style.top=YY;
}
else if (ns4){
YY=window.innerHeight;
document.point1.pageY=YY;
document.point1.visibility="hidden";
}
else if (ns6){
YY=window.innerHeight
document.getElementById('point1').style.top=YY
}


function reloc1()
{

if(yon==0){YY=YY-xstep;}
else{YY=YY+xstep;}
if (ie){
ch=document.body.clientHeight;
oh=point1.offsetHeight;
}
else if (ns4){
ch=window.innerHeight;
oh=document.point1.clip.height;
}
else if (ns6){
ch=window.innerHeight
oh=document.getElementById("point1").offsetHeight
}

if(YY<0){yon=1;YY=0;}
if(YY>=(ch-oh)){yon=0;YY=(ch-oh);}
if(ie){
point1.style.left=XX;
point1.style.top=YY+document.body.scrollTop;
}
else if (ns4){
document.point1.pageX=XX;
document.point1.pageY=YY+window.pageYOffset;
}
else if (ns6){
document.getElementById("point1").style.left=XX
document.getElementById("point1").style.top=YY+window.pageYOffset
}

}

function onad()
{
if(ns4)
document.point1.visibility="visible";
loopfunc();
}
function loopfunc()
{
reloc1();
setTimeout('loopfunc()',delay_time);
}

if (ie||ns4||ns6)
window.onload=onad


Simply add the code in your js ext.

Preview: My Profile

Credits: Bruce Anderson

_________________
"Life is Useless Without Techmates"

http://profiles.friendster.com/111675865

How to make JS(javascript) File?
Click here

How to make CSS(cascading style sheets file)?
Click here
Back to top Go down
View user profile
 
Floating objects II (up down effects)
Back to top 
Page 1 of 1
 Similar topics
-
» In Search of Water Effects Advice
» Lava effects tutorial?
» XAS - Blood Effects
» Clarification on dark world monster effects
» River table and floating boat

Permissions in this forum:You cannot reply to topics in this forum
TechMates :: Friendster Design and Development :: Friendster Tricks and Tutorials :: JavaScript-
Jump to: