Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Cool function

Status
Not open for further replies.

Analog

New Member
1. Goto a site like:

https://www.google.com

or

https://news.bbc.co.uk/

2. Go up to the address bar and paste this in and hit enter:

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

3. Fun, isn't is???????????????
 
You need to paste it in to the tool bar when a page containing images is displayed, if you paste it in to a blank tab nothing will happen.
 

Attachments

  • Cool function.PNG
    Cool function.PNG
    195.3 KB · Views: 272
Last edited:
AllVol said:
Didn't do anything for me, either.

For whatever reason, this board puts a space where it doesn't belong, I can't seem to get rid of it:

Interval

comes out as:

Inter val

Just delete that space and it works. Sorry about that!:rolleyes:
 
AllVol said:
Didn't do anything for me, either.
What browser are you using?

Do you have Java scripting enabled?

I've tried it on Opera, Firefox and Internet Explorer 7.0 and it works on all of them.
 
I think you just need to remove the space like Analog said. It didn't work for me until I did that.
 
There are some syntax errors in the script. I have just fixed
Code:
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);
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top