Forum Moderators: open

Message Too Old, No Replies

Moving images around using html, javascript, or css

         

KoRn101

5:46 pm on Jun 10, 2008 (gmt 0)

10+ Year Member



I have this <table> of images (5 images) and I have them saved on my computer under .html so that I can open them as a webpage on my internet browser. I open it up and the images come up. That was my first step. The next thing I've been wanting to do was to get those pictures to move around in different directions. I know it
s somehow possible, because I know someone who went WAY beyond that by having a javascript link that scrambled all of the images on the screen if you put it in the address bar. No matter what site you were on or how many iamges there were. Anyways, I'm wondering how to do this with what i've done. I'm starting out small, and I'll work my way up to something like what he did. Thanks.

bill

5:27 am on Jun 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld KoRn101.

Are you talking about rotating the images, say 90 or 180 degrees, or are you trying to shuffle the images position within the table?

Trace

2:55 pm on Jun 11, 2008 (gmt 0)

10+ Year Member



He's referring to this;

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 );

You can paste that directly in your address bar and watch the images got nuts.

Basically, all it's doing is modifying the top and left values of document.images

bill

5:44 am on Jun 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That's an interesting, yet annoying trick. ;)