Logo


Fancy javascript intro in 55 lines of code

Posted in ajax, Javascript by Dragan on the May 26th, 2008

Tonight I was supposed to do some boring database related stuff, but instead I got some ideas about
playing with table cells, random access and opacity.

Result is quite interesting, and it shows true power of Javascript. I suppose it would take lot more trouble to do something similar in flash, and if even if it could be done, this method gives you lot more control.
(For example you can add specific onmouse effects/events on some table cells ;) )

So, here it is, 55 linse of javascript, no framework used:

ss2

Demo:
http://dragan.yourtree.org/projects/javascript-intro/

UPDATE

and now something even more crazy than our last example:
really nice mouse effect in just 18 lines.
(using prototype though :) )

ww2

Demo:
http://dragan.yourtree.org/projects/js-mouse-grid/

I'm starting to wonder, is it possible to make, lets say 400x400 "display" made from 1x1 table cells and make an javascript demo, like they did in the 90's...
You know, plasmas, rotating cubes, etc.. :)

Viewed 37799 times by 12015 viewers

4 Responses to 'Fancy javascript intro in 55 lines of code'

Subscribe to comments with RSS or TrackBack to 'Fancy javascript intro in 55 lines of code'.

  1. Luka said,

    on June 8th, 2008 at 4:03 pm

    the second example doesn't work in IE7

  2. Dragan said,

    on June 8th, 2008 at 5:55 pm

    Thanks Luka, i've forgot el.style.filter='alpha(opacity = '+op+')'; for IE
    now it works, but is still 5-10 timer slower than in FF or Safari :(

    seams that IE cant handle that much cells (?)

  3. Ivan said,

    on June 13th, 2008 at 10:53 pm

    Both demos doesn't works on FF.

  4. Dragan said,

    on June 14th, 2008 at 1:27 am

    It does work in FF.

    What version of FF are you using and on what OS?
    And is the Javascript turned On?

Leave a Reply (English only)


All Rights Reserved, Copyright © 2007 Dragan Bajcic.
YourTree | Dragan@YourTree | LG Shop | Web Development and Consulting | Flyer Distribution UK