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

Chapter 5. Forms, Cookies, Windows, and ... > Dynamic Positioning In Navigator and...

Dynamic Positioning In Navigator and Internet Explorer

So far, the two ways of creating layers and dynamically positioning them after a page has loaded have been covered respective to the supporting browser. So how do you create HTML pages that use layering that will work on both Netscape Navigator as well as Internet Explorer? Until both browsers support the standard that is currently being developed, both methods must be used along with some extra code to determine browser type.

Listing 5.12 merges the code from the <div> example and the code from the <layer> example. Using JavaScript to determine the type of browser, two layers (one red and another plain text) are created using either the <div> tags or the <layer> tags. The red box contains buttons that will move the red box around the browser window. The red box also has a button that will make the text box disappear and reappear. The actual moving of elements is accomplished by changing the value of the layer's properties in the case of Netscape Layers or Cascading Style Sheet properties in the case of a <div> block. When using Netscape Navigator, you will notice that when the buttons move, the text associated with buttons will sometimes get jumbled. This is because Netscape does not refresh the entire screen when a layer property is changed. Internet Explorer does a much better job of refreshing the screen when the style sheet properties are changed.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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