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
Best Price
Online Shopping
Find Software
Compare Prices
Boat Donations
Calling Cards
Computer Deals
Logo Design
Web Hosting Directory
Car Donations
Desktop Computers
Web Design
Cell Phones
Compare Prices

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


Storage Networking , Part 1
eBook: A storage network is any network that's designed to transport block-level storage protocols. But understanding the ins and outs of networked storage takes you deep into several of protocols. This guide covers SANs, Fibre Channels, Disk Arrays, Fabric, and IP Storage. »

Storage Networking 2, Configuration and Planning
eBook: Picking up where Part 1 left off, Part 2 of our look at storage networking examines configurations for SAN-attached servers and disk arrays, and also includes a look at the future of IP storage. »

Storage Management Costs in the Enterprise: A Comparison of Mid-Range Array Solutions
Whitepaper: Many factors contribute to the ownership cost for enterprise storage. These include (but are not limited to): physical capacity relative to physical space requirements, performance capacity for data transfer and system reaction time, software maintenance and updates, expandability and flexibility, and much more. »

Storage Is Changing Fast  Be Ready or Be Left Behind
PDF: The storage landscape is headed for dramatic change, thanks to new technologies like Fibre Channel over Ethernet (FCoE), pNFS, object-based storage and SAS that will affect everything from NAS and SANs to disk drives. Get the knowledge you need to make the most of your storage environment, now and in the future. »

HP StorageWorks EVA4400
Demo: Dont settle for an expensive and complex array that lacks functionality. The HP StorageWorks EVA4400 delivers virtual storage with enterprise class functionality at an affordable price. »

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)

Browser-specific Dynamic Positioning Differences

February 1st 1998

As stated earlier, both Microsoft and Navigator support changing an element's CSS-P attribute values dynamically, after the Web page loads. However, each browser uses a different technique and, in some cases, different attributes, to perform the same action.

With Netscape, the positioned element is accessed via the document object, and can be found within the layers built-in array, or can be accessed directly from document. So if a Web page contains the following DIV block:

<DIV id="test" style="position:absolute; left: 100; top: 150">
some contents
</DIV>

changing the element's position using JavaScript can be accomplished using the following technique:

document.test.left = 10;
document.test.top = 10;

or the following technique:

document.layers["test"].left = 10;
document.layers["test"].top = 10;

The Resources section, below, has a link to Netscape's Dynamic HTML documentation.

Microsoft has a different technique for applying dynamic HTML changes. First, the element can be accessed via a couple of different techniques. One technique is to access the element directly by its name, or identifier. A second technique uses the all built-in collection and accesses the element directly using the item method, or indirectly using the tags method to access a group of elements. In addition, all CSS style changes, including those for positioning, occur through the style attribute/object. So, applying a change of location for the DIV block, defined earlier, could be accomplished using:

test.style.pixelLeft = 10;
test.style.pixelTop = 10;

or using the technique:

document.all.item("test").style.pixelLeft = 10;
document.all.item("test").style.pixelTop = 10;

Microsoft also supports more than one attribute that represents the left position of the element. With IE 4.x, the "left" attribute is actually a string with a unit of measurement type as well as the measurement value. To set a pixel value for either the top or left properties, the developer needs to use the pixelLeft or pixelTop properties. The resources section below has a link to Microsoft's online documentation that includes a complete listing of the DHTML attributes.

You can code for each browser each time you want to make a change, such as in the following:

if (navigator.appName == "Microsoft Internet Explorer") {
   test.style.pixelLeft = 10;
   test.style.pixelTop = 10;
   }
else {
   document.layers["test"].left = 10;
   document.layers["test"].top = 10;
   }

This type of "test and change" routine works. However, having to repeat the browser testing each time one wants to use DHTML could and will get tiring. In addition, if either browser changes its technique, then all of the DHTML implementations would need to be altered in all of the Web pages where the implementations are used.

So, what's a solution to the cross-browser DHTML problem? Creating cross-browser objects, and hiding the browser differences.

Creating Cross-Browser DHTML Objects
Creating Cross-Browser DHTML Objects
Creating Cross-Browser Objects



Up to => Home / Authoring / DHTML / CB / Objects




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