Availability: |
| |||
Object properties: | Enabled , Color, Direction | |||
Supported by objects: | A, ACRONYM, ADDRESS, B, BDO, BIG BLOCKQUOTE, body, BUTTON, CAPTION, CENTER, CITE, CODE, custom, DD, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FONT, FORM, FRAME, Hn, I, IFRAME, IMG, INPUT, INS, KBD, LABEL, LEGEND, LI, MARQUEE, MENU, NOBR, OL, P, PLAINTEXT, PRE, Q, RT, RUBY, runtimeStyle, S, SAMP, SMALL, SPAN, STRIKE, STRONG, style, SUB, SUP, TABLE, TD, TEXTAREA, TH, TT, U, UL, VAR, XMP |
This visual filter is used to define a shadow effect. The filtered element is displayed as a silhouette.
The following properties are available for use with this filter:
The Enabled property was added at version 5.5 of the MSIE browser to provide a consistent way of enabling and disabling filters by assigning a true or false value to it.
The color of the cast shadow is defined by the color property and the direction property specifies the angle of the shadow with respect to the original filtered element's location. This value is specified in degrees, measured in a clockwise direction from 0 to 359 as the values increase.
You may want more control over the shadow appearance and so other filters might be closer to the desired effect. This one is good for a simple shadow effect. The example shows it being applied to an image.
Filters are defined in style sheets as if they were a function call with its arguments expressed as name=value pairs. This is not the typical way to define arguments so you should be aware of this anomaly when working with filters.
<HTML> <HEAD> </HEAD> <BODY> Normal--> <IMG ID="NORMAL" SRC="./Logo150.gif"> Filtered--> <IMG ID="MYIMAGE" SRC="./Logo150.gif"> <BR> <SCRIPT> myFilter = "progid:DXImageTransform.Microsoft.Shadow(direction=120, color=yellowgreen)"; document.all.MYIMAGE.style.filter = myFilter; </SCRIPT> </BODY> </HTML>
See also: | Filter object, style.filter, style.textShadow |
Prev | Home | Next |
filter - RevealTrans() | Up | filter - Slide() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |