skip to main | skip to sidebar

Amos B - NYU Web Dev Fall 2008

Saturday, October 18, 2008

Basic Prototype.js Examples

  • $() is short-hand for document.getElementById()
  • $$() allows you to use CSS-style selectors to get a list of matching XHTML elements
  • the .setStyle() function allows you to set styles of any Element
  • create "event observers" to detect page loads, mouseover events, mouseout events, and click events on any element
  • The functions .addClassName() and .removeClassName() allow you to add and remove class names from any element. This example also shows how to use event observers.
  • Using the .cumulativeOffset() function of any element gives you its exact position (in pixels) on the page
  • Using the .getDimensions() function of any element gives you its exact width and height in pixels
Posted by Amos Web Dev at 12:31 PM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

What do you want to learn next class?

Blog Archive

  • ▼  2008 (51)
    • ►  December (3)
    • ►  November (23)
    • ▼  October (17)
      • Paragraph Typography
      • Elastic Layouts
      • Client-Side Assignments Must Be Complete
      • Class Mailing List
      • Preventing Flickering on Mouseover and Mouseout Ev...
      • Class 6 - In-Class Assignment - Templating
      • PHP Tutorial
      • Basic Prototype.js Examples
      • Basic Javascript Examples
      • Prototype.js - A Javascript Framework
      • Class 5 - In Class Assignment
      • Standard Ad Sizes
      • Regular Expressions
      • Class 4 - In Class Assignment
      • Class 3 - In-Class Assignment #1
      • Updated Class Blog List: Goodbye Netvibes
      • The Secret to Layout: Float and Clear
    • ►  September (8)

About Me

Amos Web Dev
View my complete profile