Copy and paste the code below in address line ofВ page with picturesВ and see the pictures flying effect. No harm, tested with Internet Explorer 6.0, 7.0, В Opera 8.54В and Firefox 1.5 (0.6, 0.7).
IMPORTANT: after you pasted it into the browser address line, replace all quotes with single quotes (because of UTF-8 encoding).
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+’px’; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5+’px’}R++}setInterval(’A()’,5); void(0)
You can also click here to download and cut-and-paste the code in ASCII, no changes needed in this case
Sample pictures:





10 comments ↓
do not work
It’s really important to manually replace all four double quotes with single quotes. Without this step it generates javascript error, instead of nice effect.
Makes no sense.
So why didn’t you put the correct code with single quotes on this page?
I did. The code is correct.
In fact, it works fine with single or double quotes, BUT, only for plain text. The problem is not in the code, it’s in copy-paste step.
When it copied from HTML page to address line, quotes got replaced with some other UTF-8 symbols, which look like quotes.
it works with internet explorer 7.0! replaced double quotes with single quotes (all 4 of them), then hit END button, then pressed ENTER.
Still does not work. May be it’s better to make this script as a link so everybody could click at it? Firefox 1.5.0.7 at Windows and 1.5.0.6 at Linux doesn’t work. M$IE surely works…
AFAIK Firefox does it right when it refuses to work. Properties “top” and “left”, their values to be correct, must be set not only with numbers, but supplied with unit definitions also, so concatenate it with ‘px’ string like this: Math(…)+…+’px’, that way you’ll set it right.
Anyway, address string is not working, but my standalone local test page is. Make javascript a clickable link (start), replacing all double quotes with single ones.
Evgeniy, Thanks for suggestions! I appreciate your inputs!
works fine in Safari and Firefox on OS X tiger
Works fine for me. Just remember to double-check that all are single quotes, not backwards single quotes.
Perhaps this script can be made beettr, such as putting in a function to make a single image fly or not? I would be interested in that
Hey, that’s too funny ! Make a bookmarklet with it :p
You must log in to post a comment.