Google

Funky Javascript!!

Wednesday, October 11, 2006

OMG ! This is the most inventive and coolest tricks i've ever found ^^ (got it from digg ^^), if you are browsing a site that contains some images then try to copy and paste this code below and the paste it to the URL / Address bar ! Then ENTER !

javascript:{var R=0, x1=.1, y1=.05, x2=.25, y2=.24, x3=1.6, y3=.24, x4=300, y4=200, x5=300, y5=200, I=document.getElementsByTagName("img"), L=I.length; setInterval(function (){for(var i=0; i-L; i++){var S=I[ i ].style; S.position='absolute'; S.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; S.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++},5); void(0)}

and there's even some modification to the script, which ask you to enter the speed ;)

javascript:var speed=prompt(%22what speed for flying images? higher is slower, fastest and smoothest is 5%22); 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(%22img%22); 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)+%22px%22; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+%22px%22}R++}setInterval('A()',speed); void(0);

or maybe not the images, but the text ? ;)

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("font"); 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()',75); void(0);


Hm.. maybe i'll play with these a bit further ;) if i have some spare time of course (don't expect much :P)

Try it on zlythern here ;) You'll be amazed! :)



[source: via]


7 comments:

rxbbx said...

Nice find.. i like it.. :)

teddY said...

Hmmm I'm sure that the outcome looks nice! Don't have the chance to do it since I've tried it on Firefox and othing happens. Perhaps I should try on IE next time =) Those are really some quality digggggs! XD

Efendi said...

@rxbbx: hello there ^^ welcome to zlythern ;) glad you liked it ;) drop by again ok :)

@teddy: hm..it worked fine on FF ;) the 1st and 2nd looked for the tag <img> and the last one looked for the <font> tag :)

but my friend today told me that the 2nd one doesn't work on IE :P

gondolier said...

!!
nice code!!!
it's so cute
wahhahaha

Efendi said...

@gondolier: yeah ^^ creative ain't it ;) i'm planning to put it up here, just to provide as some kinda easter egg maybe :P hehehe

ARS CooL said...

Not walking in Firefox? :(

Efendi said...

alo mas ARS :) welcome ^^

hmm... pakenya firefox berapa ? g pake FF 1.5.0.7 and workin' fine ;)

try the 1st javascript ;) as for the 2nd one it's not workin' on IE :P

About Me

My Photo
Efendi
An ordinary, a bit 'geeky' guy, who enjoy blogging about all unique things across the internet world. Blogs about the blogosphere, scripts, fun, games, interesting stuffs, etc. Currently staying and working in Singapore.
View my complete profile