• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. The Document Object Model > Building a Cross-Browser DOM

Building a Cross-Browser DOM

Like the Rosetta stone, the information returned from detecting the browser's DOM type can translate the DOM for a particular object in the Web page being displayed by the browser. The basic idea is to include methods for all three DOM types in a function called findDOM(), which uses if statements to determine which DOM type to use. A DHTML function then uses findDOM() to build the DOM for a particular object and access that object's properties (Figure 11.19).

Figure 11.19. The first alert shows the object's ID. The second alert is the object's distance from the top of the screen, in pixels.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint