9 Funniest JavaScript Effects

December 25, 2010 · 28 comments

by Phong Thai

9 Funniest JavaScript Effects

Everybody knows the Internet is the environment that we can use for a lot of things. The Internet is getting more and more important, we can use it for working, learning, for entertaining …

Only in the aspect of entertainment, we use the Internet to play online games, to search, listen & download the favorite songs, videos, movies, …

The Internet also is the very good environment for studying, it helps us in looking for the materials, solving our problems, getting the supports from the other persons, … Especially in the field of computers in general, web programming in particular; many people think the programming languages are only for working, there’s no joy in it.

That’s reason why I wrote this post, I just want to say to all: with JavaScript, you can find some little joys; JavaScript can make many funny things that you may not have realized. Here’s list of funniest things JavaScript can do.



1. Pictures flying as a snake around the mouse pointer

Pictures flying as a snake around mouse pointer

Just paste the JavaScript below into the address bar of any browser then press Enter, it makes all pictures on the current web page fly around like a snake when you move the pointer.
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; var 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++}tag=setInterval('A()',5 );document.onmousedown=function(){clearInterval(tag);for(i=0; i<DIL; i++){DI[i].style.position="static";}}; void(0)
In the above JavaScript, you can change document.getElementsByTagName("img") to any HTML tag that you want to apply.

Here’s some another versions of this effect: 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);

2. Transform the web page into the eaditable mode

Transform the web page into the eaditable mode

javascript:document.body.contentEditable='true'; document.designMode='on'; void 0 This JavaScript code lets you modify any web page in real-time; and with Firefox, you can even save the modified web pages to your computer. You can do many funny things with the simple JavaScript above, such as: faking the screen capture of some proof, faking some hot news for April Fool’s Day… quickly.

3. You must love me

You must love me

Give your lover the link of this effect, then ask her to answer the question “Do you love (marry) me?” and she can’t repudiate, lol.

Demo, Source

4. Joking Error Message Alert box

Joking Error Message Alert box

Like the above funny JavaScript but this script uses the picture to make the choices; maybe from the idea of this joke plus some different pictures, you can make more funny jokes.

5. The text based Cheerleader Animation

The text based Cheerleader Animation

No need to say more about it, let try it out by yourself.

Demo, Source

6. Faking Textarea on Typing

This funny script made to prove that you’re too trusting of people. Don’t believe me? Just check it by yourself.

Demo, Source

7. Unclosable Window

Yeah, you should recheck your mind carefully before run this script, maybe it will not be funny; and you have to enable popup for this damn script, lol.

Demo, Source

8. Shaking the browser window for a while

Change the dimension of your browser window to Normal mode, maybe a half of the screen resolution is best; then run the code below by pasting it into the address bar and codessing the Enter key. javascript:function Shw(n) {if (self.moveBy) {for (i = 35; i > 0; i--) {for (j = n; j > 0; j--) {self.moveBy(1,i);self.moveBy(i,0);self.moveBy(0,-i);self.moveBy(-i,0); } } }} Shw(6)

9. Love Tester

Love Tester

A small JavaScript to test the love compatibility’ between two people. I & this script are not responsible for any broken relationship you tried, lol.

Demo, Source

Simple & Funny Games by JavaScript

Simple & Funny Games by JavaScript

In the end of this list, maybe this is not a script, I just want to list some resources that you can play some JavaScript games for relaxing. Certainly, the games made by JavaScript will be simple but they’re not boring any; they’re really games that you can find a little of fun.
Game Scripts
25 Amazing JavaScript Games
JavaScript Gaming
Free JavaScript Games Download
Free JavaScript Games


Some JavaScript codes can be executed in the address bar of browser immediately, others must be used as a HTML file for affecting. But I hope you’ll like this post and find some funny things; if you know anymore, please let me know.


Find more about jQuery here:

Author : Cao Phong

Phong Thai is a Web Developer, Web Coder for 9+ years with PHP, JavaScript, CSS. He is the creator of JavaScriptBank.com & 9BlogTips.com – provide thousands of free JavaScript code examples, web development tips and tricks, helpful blogging guides. Follow him on twitter@js_bank or connect with him on facebook@jsbank if you want.

{ 20 comments… read them below or add one }

help June 28, 2013 at 2:30 am

HELP! the snake one wont deactivate! I tried closing and coming back on but it stays!


max January 30, 2013 at 12:52 am

it is fun to combine #2 and #3


Kuldeep December 27, 2012 at 11:22 am

very useful 9Funniest JavaScript Effects.. Thanks


chathuranga March 28, 2012 at 6:05 am

send me a jQuery for Flip book


Charles November 14, 2011 at 1:07 am

Couldn’t you simply tab to the “no” button on the “Do You Love Me?” Script?


cheap custom jerseys May 19, 2011 at 10:14 am

9 Funniest JavaScript Effects


Canuck January 22, 2011 at 10:11 pm

http://www.addeffects.net has many java scriptlets to use with web browser for adding effects to any webpage, just enter a URL.

Example usage:


Peter Gehrig December 22, 2010 at 10:29 pm

JavaScript is even able to generate some kind of image-distortion effect!


Mobile Spy Software July 13, 2010 at 7:25 am

Great post. Really funny and and amazing JavaScript Effects. Good Share dude. I appreciate your nice post. You have amazing knowledge for share. Thanks


hermes handbags July 9, 2010 at 11:23 am

@Rotary, not just possibly…definitely! But you should be safe just having fun with them…


Windows Tips July 1, 2010 at 2:56 pm

WOW! Amazing and cool javascript effects.. thanks for sharing. I especially like the error window!


SMS Spy June 22, 2010 at 1:13 pm

Really amazing and funny javascript effects Nice post. Good share. Thank you.


Chief Creative Officer June 20, 2010 at 8:18 pm

I’ve played around with javascript effects for a while but I always wanted something that would let me decorate my site for Halloween and Christmas. Last year I got tired of waiting for someone to do it and created NoviDomiDeco.com to do just that and more. The point is to consolidate a variety of effects under one easily accessible interface so that folks with very little programming experience could do fun things with GIFs, JPGs and PNGs on any site–even some hosted blogs and social network sites that allow javascripts.

Now that we’re public, we’re looking for suggestions to add even more effects to our Decoration Engine. Feel free to create an account, play around with it and make some suggestions to us.


registry cleaner May 24, 2010 at 6:14 am

i search your blog form google,great post,thanks for share


Rotary Laser Level Expert February 19, 2010 at 9:15 pm

Cool stuff.
Thanks for sharing – Possibly a bit career limiting to use them on clients sites.


tripwiremag February 19, 2010 at 10:02 pm

@Rotary, not just possibly…definitely! But you should be safe just having fun with them… 😉


Gilroy February 15, 2010 at 4:18 pm

Amazing and cool javascript effects.. thanks for sharing.


stuart johnson February 11, 2010 at 1:05 pm

Hi there…
It was such a nice post..

thamk you.


Michael February 6, 2010 at 11:31 am

The “Do you love me” Script was funny 😀


Federico Moreno February 6, 2010 at 9:57 am

#2 and #4 are really fun to play with ^^


Leave a Reply

Your email address will not be published. Required fields are marked *

{ 8 trackbacks }

Previous post:

Next post:

Web Analytics