pgGetStyle() and opacity

Help for using specific functions

pgGetStyle() and opacity

Postby Clifton » Sun Jan 19, 2014 9:18 pm

If you use pgGetStyle() and attempt to get opacity from an object that does not have opacity applied, the this function will return an empty string ( "" ).

Why does this behavior occur?
  • HTML elements apply style.opacity to define the transparency level of an object. The range is 0 (full transparent; basically invisible to the eye) to 100 (full opaque).
  • If an object has no style.opacity property set, the object is considered fully opaque and the opacity setting is null or empty.
  • The PowerPac generally removes the opacity setting for objects with opacity=100 because this fixes a display issue in IE8 browsers where graphics and fonts may appear blotchy.
If you use pgGetStyle() to check the opacity of an object, then you must include logic that handles situations where the function may return "" instead of a predicted integer from 0-100.
EXAMPLE:
Image 2.png
Image 2.png (3.1 KiB) Viewed 1301 times
NOTE: pgGetStyle() will usually return an empty string for objects that are fully opaque (opacity = 100).
Attachments
pgGetStyle_opacity.zip
Sample TBK
(36.59 KiB) Downloaded 103 times
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Return to Function Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron