Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
 Discussion Forums
 HTML, XML, JavaScript...
 Software Reviews
 Editors,Others...
 Top100
 JavaScript Tutorials, ...
 Tutorials
 ASP, CSS, Databases...
 Discussion List
 FAQ, Roundup, Configure ...
 Authoring
 HTML, JavaScript, CSS...
 Design
 Layout, Navigation,...
 Graphics
 Tools, Colors, Images...
 Software
 Browsers, Editors, XML...
 Internet
 Domains, E-Commerce, ...
 WDVL Resources
  Intermdiate, Tutorials,...
 WDVL
 Discussion Lists, Top 100,...
 Technology Jobs


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us
Find Software
Domain registration
Baby Photo Contest
Rackmount LCD Monitor
Compare Prices
Compare Prices
Hurricane Shutters
Online Education
PDA Phones & Cases
Corporate Gifts
Corporate Awards
Server Racks
Career Education
Shop

Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


  eKit: Essential HP Solutions for Your Data Center
Data protection and disaster recovery tools help keep data secure and available under the worst of circumstances.

Download this eKit and get:

eBook: Guide to Storage Networking
eBook: Storage Networking 2, Configuration and Planning
Whitepaper: Storage Management Costs in the Enterprise: A Comparison of Mid-Range Array Solutions
Whitepaper: Virtualization - It's Not Just for Enterprises Anymore
Whitepaper: Continuous Real-time Data Protection and Disaster Recovery

Click Here!
Top 10 Articles
  1. Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
  2. JavaScript Tutorial for Programmers
  3. Design
  4. JavaScript Tutorial for Programmers - Objects
  5. JavaScript Tutorial for Programmers - JavaScript Grammar
  6. JavaScript Tutorial for Programmers - Versions of JavaScript
  7. Cascading Style Sheets
  8. JavaScript Tutorial for Programmers - Embedding JavaScript
  9. JavaScript Tutorial for Programmers - Functions
  10. Authoring JavaScript
Domain Name Lookup
Search to find the availability of a domain name. Just enter the complete domain name with extension (.com, .net, .edu)

Creating Cross-Browser DHTML Objects

February 1st 1998

This is a tutorial in how to use DHTML to create a tabbed index card stack for the 4th generation browsers from Microsoft and Netscape. It's a three part series covering:
  1. How to create Cross-Browser (CB) Objects, and a simple test case using the objects.
  2. Using CB objects for one index card application which forces all the content to be preloaded, including all of the index "card" contents.
  3. A second index card application using a LAYER element for Netscape Navigator and an IFRAME element for Microsoft Internet Explorer, which loads content for each index card, as the tab for the card is selected.

Dynamic HTML (DHTML) is the technology that provides Web developers with the ability to modify the position or appearance of an HTML element based on some event occurring. Examples of DHTML include dynamically altering the size of an HTML element, altering its location within a Web page, or how the element is clipped. Microsoft introduced DHTML into Internet Explorer with version 4.0 and Netscape introduced DHTML into Navigator with 4.0. Unfortunately, each company's DHTML syntax and capabilities differed, a very real problem for Web developers who have to create pages that work with both browsers.

There is, however, a solution to at least minimize these cross-browser DHTML differences, the cross-browser objects, and this article provides the techniques you can use to create your own CB objects. Note that the article covers advanced JavaScript techniques, and will be easier to follow if you have worked with JavaScript previously.

Creating the HTML Content

Microsoft and Netscape both support a draft W3C specification called CSS Positioning, or CSS-P, though the actual specification has now been absorbed into the current effort for CSS2. CSS-P provides style sheet specifications for positioning a subset of HTML elements within a Web page.

As an example of using CSS-P, the following block of code positions the header and paragraph enclosed within the DIV block at an absolute position starting at 100 pixels to the left, and 150 pixels from the top:

<DIV style="position:absolute; left: 100; top: 150">
<H1>The Header</H1>
<p>
The paragraph
</p>
</DIV>

What are the attributes that can be set using CSS-P? First, the element must specify the position attribute, set to a value of relative, for relative positioning, or absolute for absolute positioning.

In addition to setting the position attribute, the Web page developer can also set the following CSS-P attributes:

  • left - element's left position
  • top - element's top position
  • visibility - whether element is hidden, visible, or inherits its visibility from the containing element
  • z-order - element's position in a stack if elements are layered
  • clip - element clipping
  • overflow - how overflow contents are handled when the element's height or width are too small for content

A complete definition of the CSS-P attributes can be found in the document "Positioning HTML Elements with Cascading Style Sheets" in the Resources section, below.

Microsoft and Netscape support dynamic dynamic positioning for elements that have been statically positioned using CSS-P. Netscape also supports dynamic positioning of LAYER elements.

Each browser supports CSS-P for a different subset of HTML elements, but each does support equally, CSS-P for DIV and SPAN elements. A DIV element is one which acts as a container for other HTML content, and which surrounds the contained content with line breaks. The SPAN element, on the other hand, is meant to be a container for non-block content, meaning that the content is displayed without line breaks. As most content that is dynamically altered is usually within a block, rather than within a line, the cross-browser objects are created from DIV blocks only, at this time.

Browser-specific Dynamic Positioning Differences



Up to => Home / Authoring / DHTML / CB




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers