YUI recommends YUI3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

This documentation is no longer maintained.

YUI Library Examples: Dom Collection

Dom Collection: Examples

The Dom Collection comprises a family of convenience methods that simplify common DOM-scripting tasks, including element positioning and CSS style management, while normalizing for cross-browser inconsistencies.

  • Using setXY: Positioning elements relative to the document coordinate system can be quite a challenge. The Dom Utility provides this method to do it for you.
  • Using getXY: Getting element positions relative to the document coordinate system can be quite a challenge. The Dom Utility provides this method to do it for you.
  • Using setStyle: There are some differences between browsers regarding how style properties are set on HTMLElements. This method normalizes those for you.
  • Using getStyle: There are some differences between browsers regarding how style properties are retrieved from HTMLElements. This method normalizes those for you.
  • Using hasClass: This method allows you to test for the presence of a className on an HTMLElement.
  • Using addClass: This method allows you to add a className to an HTMLElement.
  • Using removeClass: This method allows you to remove a className from an HTMLElement.
  • Using getElementsByClassName: This method allows you select all of the HTMLElements on a given page that share a specific className.
  • Exploring the Dom Collection's API: The Dom Collection Explorer allows you to interact with some of the oft-used element-targeting functions in the YUI Dom Collection.

Copyright © 2013 Yahoo! Inc. All rights reserved.

Privacy Policy - Copyright Policy - Job Openings