Fly images with javascript
Published by Aslam
Want to see images in a page flying all over the page?
Search in google image. better select old version.
Just Copy and paste Below Javascript-code in to your browser's Address Bar.
Come to the beginning of address bar, and add "JAVASCRIPT:" if there is not exist same.
Then hit Ok
Hurray.. !!
Not Working?? Dont worry, there is always another way.
Try copy and pasting below script into your addressbar.
Come to the beginning of address bar, and add "JAVASCRIPT:" if there is not exist same.
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; var DI= document.getElementsByTagName("img"); DIL=DI.length; function A(){for(i=0; i<DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5+"px"; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5+"px"}R++}tag=setInterval('A()',5 );document.onmousedown=function(){clearInterval(tag);for(i=0; i<DIL; i++){DI[i].style.position="static";}}; void(0)
Then hit Ok
Hurray.. !!
Code Explained
javascript:
R=0; //Assigning Variables and starting values.
x1=.1;
y1=.05;
x2=.25;
y2=.24;
x3=1.6;
y3=.24;
x4=300;
y4=200;
x5=300;
y5=200;//
var DI= document.getElementsByTagName("img"); // getting all img id's from our document .it will collect all img tags.
DIL=DI.length; //Storing the total number of images to variable DIL.
function A() // Declaring a function
{
for(i=0; i<DIL; i++) //loop while the looping of process end .
{
DIS=DI[ i ].style; //getting the style of each img tag
DIS.position='absolute'; //changing the position of images to absolute
DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5+"px"; //Assigning Left position value to image.
DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5+"px" //Assigning top position value of images.
}
R++ //after each loop , incresing the value of r + 1.
}
tag=setInterval('A()',5 );
document.onmousedown=function() // Clearing the values and return to static position when we right click on page.
{
clearInterval(tag);
for(i=0; i<DIL; i++){DI[i].style.position="static";
}
};
void(0)
Not Working?? Dont worry, there is always another way.
Try copy and pasting below script into your addressbar.
javascript:R=0;x1=.1;y1=.05;x2=.25;y2=.24;x3=1.6;y3=.24;x4=300;y4=200;x5=300;y5=200;DI= document.images;DIL=DI.length;function A(){for(i=0; i<DIL; i++){DIS=DI[ i ].style;DIS.position='absolute' ;DIS.left=Math.sin(R*x1+ i*x2+x3)* x4+x5;DIS.top=Math.cos(R*y1+ i*y2+y3)* y4+y5;} R++;}setInterval('A()',5);void(0);
Comments
Post a Comment