c-- styles for logos and headline links do not modify internet, red, or black styles -->

Intranet Journal   Earthweb  
Events Jobs Premium Services Media Kit Network Map E-mail Offers Vendor Solutions Webcasts

   Intranet Journal Subjects
Search Earthweb

Privacy Policy



internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

internet commerce
Be a Commerce Partner
















 

[ Home | Discussion Forum | How Do I... | Lotus Notes Intranets | Microsoft SharePoint | Products | Shopping  ]

free news!

Dynamic Properties in Dynamic HTML (DHTML)



Tutorial TOC

  1. Introduction
  2. Implementing Dynamic Properties
  3. Creating expressions and formulas
  4. The setting expressions
  5. The getExpression() method
  6. The removeExpression() method
  7. Summary

The getExpression() method

After a property has it's value set with either the setExpression() method or the expression() method, you can read this property. s expression or formula using the getExpression() method. This is a useful way to check the current state of a certain element and then if it meets a certain condition, you may want to apply another expression to this property or even remove the expression using the removeExpression() method. An example of this may be an application that has a series of text dynamically sized in relation to the browser width. After clicking a button, you may want to now size it to the browser. s height. Using getExpression(), you can read the current expression of the titles and change them if they are sized in relation to the browser. s width. This will be covered in the next section. The getExpression() method is very simple to use, it accepts only one attribute, and that is a string representing the property which you. d like to read an expression from. An example of this is shown below:

Var theExpression = box1.style.getExpression("left")

In this snippet, the return value of getExpression("left") of the box1 element will return what ever formula was set on this property with setExpression() or expression(). If by any chance the expression has been removed or there was no expression set for this property in the first place, then the return value will display as undefined. Let's take a look at the next example, it build upon the setExpression() example, by now adding a display area showing the expression set for all the boxes on the screen.

 

 

[print version of this page]

Of Interest
· An Introduction to DHTML

· Express Yourself