Spry widget editing functions

Dreamweaver CS5 provides enhanced editing functions for Spry and other dynamic widgets.

element.getTranslatedAttribute()

Availability

Dreamweaver CS3.

Description

This function is the same as the W3C getAttribute() function, but acts on translated attributes. The element.getTranslatedAttribute() function retrieves an attribute value by name.

Arguments

name

  • The name argument is a DOMString that is the name of the attribute to retrieve.

Returns

Returns the name of the attribute as a DOMString. If the attribute does not have a specified or default value, this function returns an empty string.

element.removeTranslatedAttribute()

Availability

Dreamweaver CS3.

Description

This function is the same as the W3C removeAttribute() function, but acts on translated attributes. The element.removeTranslatedAttribute()function removes an attribute by name. If the attribute has a default value, an attribute appears containing the default value and the corresponding namespace URI, local name, and prefix, if applicable.

Arguments

name

  • The name argument is a DOMString that is the name of the attribute to remove.

Returns

Nothing.

element.setTranslatedAttribute()

Availability

Dreamweaver CS3.

Description

This function is the same as the W3C setAttribute() function, but acts on translated attributes. The element.setTranslatedAttribute()function adds a new attribute with the value specified. If an attribute with the specified name already exists in the element, its value is changed to that specified in the value argument.

The value is a simple string; it is not parsed as it is being set. Therefore, any syntax included in the string is treated as simple text, and must be appropriately escaped by the implementation when it is written out.

To assign an attribute value that contains syntax intended to be recognized as an entity reference, you must create an Attr node plus any Text and EntityReference nodes, build the appropriate subtree, and use setAttributeNode to assign it as the value of an attribute.

Arguments

name, value

  • The name argument is a DOMString that is the name of the attribute to create or change.

  • The value argument is a DOMString that is the value to set for the attribute.

Returns

Nothing.

element.translatedClassName

Availability

Dreamweaver CS3.

Description

This function is the same as the element.ClassName()function, but acts on the translated className attribute.

element.translatedStyle

Availability

Dreamweaver CS3.

Description

This function is the same as the element.style() function, but acts on the translated style attribute.

Example

 var div1 = dom.getElementById("div1"); 
div1.translatedStyle.display = "none";

Get help faster and easier

New user?