Back to the Web Developer's Journal Main Page
internet.com
side nav bar

Normal DHTML pages are limited by their number of layers. More than fifteen is unusual - the file size gets too high. So why not get JavaScript to write all the HTML for the layers using its Write function and a few equations? Amazingly, it works. The result is hundreds of layers and weird and wonderful patterns produced by a tiny file (<2k).
Javascript Articles:

HOW DID THEY DO THAT???

Find out in:
Amazing HTML



Site Map

Jobs at webdeveloper.com


Check out our Web-based
Discussion Groups:

Check out and join our email-based Mailing Lists for Web developers.


Developer Channel
FlashKit
Jobs.webdeveloper
JavaScript.com
JavaScriptSource
JustSMIL
ScriptSearch
Streaming Media World
WebDeveloper.com
WebReference
XMLFiles
WDVL
Discussion Groups Book Reviews Software Reviews Download Web Tools

Over The Top With DHTML

JavaScript Generated Patterns

Andrew Starling

If you're familiar with DHTML, you'll know that layers are widely used. Text and pictures are placed between <div> and </div> tags so they can be moved around the page and selectively displayed.
May 30, 2000

But if you use lots of layers, the page soon becomes large and cumbersome. In practice it's rare to use more than fifteen.

A sneaky way round this is to get JavaScript to write the HTML for the layers, using its Write function and a few equations. And amazingly, it works. The result is hundreds of layers and weird and wonderful patterns produced by a tiny file (<2k) containing a few dozen lines of JavaScript.

Warning - Browser Compatibility

This is on-the-edge stuff and not very safe. All the demonstrations below seem to work on Netscape Navigator 4+. Internet Explorer 5 is also safe. The first four work on IE 4, but the others don't, so watch out. All other browsers (including AOL Explorer) are not recommended.

Note that IE5 is sometimes confusingly referred to as
"Explorer 4 (compatible; MSIE 5...)".

Examples

Each example launches in a new window. Please close the new window to return here. The Back button can cause these pages to crash, so the new window doesn't include one.

  • Diagonal Line

  • Ring

  • Ellipse

  • Small Circular Pattern

  • Wide Circular Pattern

  • Spiralling Pattern

  • Flower Bloom

  • Random (changes each time)

    Note, if an example fails to launch for a second viewing, it's probably because the window it launches into is already open. Find the extra window and close it to see the example again.

    More details about how it all works, including code.

  • Back to the Web Developer's Journal
    Contact WDJ   •    Suits!   •    Propheads!   •    Ponytails!
    Discuss   •    Subscribe   •    Search


    internet.com

    IT | Developer | Internet News | Small Business | Personal Technology | International | Search internet.com | Advertise | Corporate Info
    Newsletters | Tech Jobs | E-mail Offers

    internet.commerce
    Be a Commerce Partner                                
      


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers