Free content for your website, newsletters or ezines. Free articles for reprint | Lbry.com
corner Set as Homepage   |   Add to Favourites corner
 
Search for
Need more search features? Go to Advanced Search
 
 
Article Categories
Advertising
Direct Mail, PPC, Word of Mouth
Advice
Affiliate Programs
MLM
Arts
Auto & Trucks
Auto Leasing, Diesel vs. Gasoline Vehicles
Awards
Beauty, Personal Care & Grooming
Business & Finance
Finance, Management, Marketing, Sales
Careers
Communications
Computers & Internet
CD Duplication, Computers FAQs
Copywriting
EBooks
ECommerce
Education
Email
Entertainment
Environment
Family
Child Care
Food & Drink
Cooking & Recipes
Free
Furniture
Office Chairs
Gadgets & Gizmos
Games
Gardening
Gifts
Government
Health
Hair Loss, Headaches, Healthy Eating, Natural Cures
History
Hobbies
Boat Acquisition
Home Business
Home Improvement
Humour
Internet
Blogs, CGI, CSS, DHTML, HTML, Javascript, RSS
Kids and Teens
Law
Marriage
Men's Issues
Metaphysical
Motivational
Music & Movies
Newsletters
Online Business
Organization & Time Management
Parenting
Personal Security & Wellness
Credit Repair, Life Insurance
Pets & Animals
Cats, Dogs
Politics & Government
Press Releases
Psychology
Publishing
Real Estate
Home Mortgage
Recreation & Sports
Fitness, Mountain Biking, Tennis
Reference
Relationships
Religion & Faith
Scams
Science
Weather
Search Engines
Link Popularity, SE Optimization, SE Positioning, SE Tactics, Sitemaps
Self Help
Sexuality
Shopping
Signs & Astrology
Society
Work Life
Technology
Bluetooth, Podcasting
Travel & Adventure
Beach Vacations, Ski Vacations
True Life Stories
Websites
Domain Names, Site Promotion, Web Development, Web Hosting
Weight Loss
Women's Issues
Writing
 
 »  Home  »  Internet  »  DHTML  »  DHTML-Introduction
DHTML-Introduction
By Eddie Traversa | Published  01/9/2006 | DHTML | Unrated
DHTML-Introduction
Eddie Traversa
DHTML Nirvana http://nirvana.media3.net/ is a site dedicated to exploring the possibilites of DHTML. It hosts free graphics, dhtml templates and tutorials. Some of the tutorials emphasis is on Flash/DHTML integration.  

View all articles by Eddie Traversa

Think of DHTML as not a singular technology but a combination of three
existing technologies glued together by the Document Object Model (DOM):

1. HTML - For creating text and image links and other page elements.

2. CSS - Style Sheets for further formatting of text and html plus other
added features such as positioning and layering content.

3. JavaScript - The programming language that allows you to accesses and
dynamically control the individual properties of both HTML and Style Sheets.

The way JavaScript accesses the properties of an HTML document is through
the Document Object Model (DOM). The job of the DOM is to expose all the
attributes of HTML and Style sheets to JavaScript control. All you need to
know about the DOM is what JavaScript commands it accepts. Not that easy,
as different browsers have their slightly different versions of the DOM, so
they access HTML properties differently as well as display them differently.

So how do you locate an HTML element on a page and change its property?
This is the job of JavaScript. Obviously, I cant into all the details of
JavaScript or the DOM, but here is an example of how JavaScript can change a
visibility of a style sheet layer in both browsers.

Note: That every piece of HTML has a location much like a directory in a
phone book. When finding that piece of HTML you have to go through the same
hierarchy process of searching for a name in the phone book such as

(state) Washington -> (City) Seattle -> (Listings) j -> (Name) Jessica

In JavaScript, a reference to this would be equivalent to

washington.seattle.j.jessica

Now Jessica may have additional information such as her address and phone
number, so the JavaScript reference would be written this way.

washington.seattle.j.jessica.address

or

washington.seattle.j.jessica.phone

Lets transcribe the above metaphor to a DHTML document that contains a


layer [myLayer] with style attributes
[top,left,width,height,z-index,visibility,etc] and the layer contains a bit
of text "myText" (Note that the visibility attribute is set to hidden)


myText


In Netscape the address to the DIV layer "myLayer" is

document.myLayer

in Explorer it is

document.all.myLayer.style

The W3C way of identifying the address is

document.GetElementById(‘myLayer’).style

To access the properties such as visibility under "myLayer" you would use
these addresses.

Netscape

document.myLayer.visibility

Explorer

document.all.myLayer.style.visibility

W3C

document.getElementById(‘myLayer’).style.visibility

To change the visibility of this layer you would assign a value to your
JavaScript address.

Netscape

document.myLayer.visibility = "visible";

Explorer

document.all.myLayer.style.visibility = "visible";

W3C

document.getElementById(‘myLayer’).style.visibility=”visible”;

Now the previously hidden layer is now visible. This is essentially how
DHTML works, but understand there are hundreds and hundreds of attribute
properties for text, images, documents and windows. Not all these
properties are supported in both browser and sometime accessing a property
requires a few more hurdles, but if you stick to the common denominator
properties both browser use then life it a bit easier. I recommend the
excellent DHTML reference book Dynamic HTML - The Definitive Guide by Danny
Goodman (O'Riley Books) It lists all of the DHMTL properties and their
cross browser compatibilities.
Note: Republishing this article is permitted in the following conditions:
 
author by-lines are kept intact and unchanged. Hyperlinks and/or URLs provided by authors must remain active.
 
 
a link to the Lbry.com site is required in the use of articles either as print or an active url on the articles web page as below:
[ Article from Lbry.com ]
How would you rate the quality of this article?
1 2 3 4 5
Poor Excellent
Tell us why you rated this way (optional):

Send to Author Post on Site

 
Comments


Article Options
Most popular articles

»

Dementia: Will I Get It?

By N/A | Published 12/31/1969 | Health | Rating:
In the article Dementia: Just What Is It, we have learned about a frightening term, Dementia, and just what it is or, rather, how it manifests itself in the human condition. I gave 5 examples from my personal knowledge, including myself.
 
  Read the full article   Print this article  
Report An Error    

»

Triumphing Over Tantrums

By N/A | Published 12/31/1969 | Family | Rating:
Patty Hone
 
  Read the full article   Print this article  
Report An Error    

»

Celebrex Law Suits Looking Like a Strong Case

By N/A | Published 12/31/1969 | Law | Rating:
There is no data as yet that indicates how many former patients of Pfizer's anti-inflammatory and painkilling drug are filing Celebrex law suits, but given the magnitude of the company's perceived crime it is likely that there will be very many. And even a quick perusal of the alleged behaviour of the company regarding this drug seems to point to Celebrex law suits being something of a fait accompli.
 
  Read the full article   Print this article  
Report An Error    

»

Checked Into Nirvana. Where Is Joy?

By N/A | Published 12/31/1969 | Metaphysical | Rating:
Eckhart Tolle lived upto his twenty ninth year in a state of almost continual anxiety interspersed with periods of suicidal depression. Then he woke up one night with a feeling of absolute dread. The silence of the night, the vague outlines of the furniture in the dark room, the distant noise of a passing train - everything felt so alien, so hostile, and so utterly meaningless that it created in him a deep loathing of the world. "I cannot live with myself any longer." This was the thought that kept repeating itself in his mind. Suddenly he became aware that if he could not live with himself, there had to be two - he and the "self" he could not live with. He was stunned by the realization. He became enveloped by powerful feelings.
 
  Read the full article   Print this article  
Report An Error    
No popular articles found.
 
Become an Author
 
Are you a writer and you want your work published?
 
 
Do you have a website and need free publicity?
 
 
Sign up for free as a Lbry.com author and have your articles published in no time!
Click here to become an author
 
Advertising
 
 
 
 
Lbry.com Sponsors