CSS3 PIE Forums
http://css3pie.com/forum/

change PIE properties in javascript dynamically
http://css3pie.com/forum/viewtopic.php?f=4&t=1689
Page 1 of 1

Author:  mobashir [ Tue Jun 05, 2012 7:09 pm ]
Post subject:  change PIE properties in javascript dynamically

Is it possible to change PIE attributes dynamically in javascript through accessing css style object
like we can change border-width
document.styleSheets[0].rules[0].style['borderWidth'] = "2px";
same is it possible for PIE attributes like
document.styleSheets[0].rules[0].style['PieBorderRadius'] = "20px 2px 20px 2px";
but pie attributes are not loading in style array in IE. I am using pie.htc
Thanks

Author:  jason [ Tue Jun 05, 2012 7:30 pm ]
Post subject:  Re: change PIE properties in javascript dynamically

Yes and no:

1) You can modify the stylesheet rules like your snippets, however PIE has no way to be automatically notified of those changes. You would have to trigger a property change on the targeted element(s) for PIE to react to the change. Something simple like element.className += ' ' should be enough to trigger an update.

2) If you change element styles directly instead of modifying the stylesheet, like element.style.borderRadius = '2px', then PIE will react to that automatically.

Author:  mobashir [ Wed Jun 06, 2012 5:01 am ]
Post subject:  Re: change PIE properties in javascript dynamically

Got it, thank you.

Page 1 of 1 All times are UTC - 7 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/