...

View Full Version : a popular injection image placement modification problem



jhouns
08-18-2008, 11:09 PM
okay so im sure everybody knows of the code that makes images fly around....
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.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++
}setInterval('A()',5);
void(0);

well i thought in order to do something similar i should understand this more so i thought about just mocing the pictures to on place on the screen like the top left corner or something after about an hour of looking at and testing parts of this code i go to...

javascript:DI=document.getElementsByTagName("img");DI.left=26+"px"; DI.top=25+"px";

yet it still doesnt work but merely displays 25px in the top left is there anything else that will get all images into the top left hand corner or a modified version of this script. NOTE: all of this must be placed in the adress bar for javascript injection on any page.

shyam
08-19-2008, 05:59 PM
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.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++
}setInterval('A()',5);
void(0);

javascript:DI=document.getElementsByTagName("img");DI.left=26+"px"; DI.top=25+"px";

document.getElementsByTagName returns a node-list and setting the left and top of a node-list ain't gonna move the images anywhere. If you notice the code that you posted, you will notice that they are iterating through every item in the node-list and setting the left and top of the image's style object.

jhouns
08-31-2008, 10:55 PM
ahh right i get where i was wrong now thanks for all the help :):thumbsup: correct thanks to you



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum