Forums
|
|
|
|
Page 1 of 1
|
[ 3 posts ] |
|
How to set linear gradient property in Javascript
| Author |
Message |
|
Sharmi
Joined: Tue Jan 24, 2012 11:32 pm Posts: 2
|
 How to set linear gradient property in Javascript
Hi All,
I am able to set the property linear-gradient in CSS as mentioned in this Forum and this works in both Firefox and IE,
*********************** background: #F0F0F0; background: -moz-linear-gradient(#F0F0F0, #C0C0C0); background: linear-gradient(#F0F0F0, #C0C0C0); -pie-background: linear-gradient(#F0F0F0, #C0C0C0); behavior: url(/PIE.htc); ***********************
But if I want to change the color dynamically in Javascript I can use the following code, and it will work only in Firefox not in IE.
************************ controlText.style.background = "-moz-linear-gradient(#E9EDF6, #AABBDD)";
************************
The same way what is the exact replacement for the following CSS property in Javascript which will work in IE,
??????????????????????????? background: linear-gradient(#F0F0F0, #C0C0C0); -pie-background: linear-gradient(#F0F0F0, #C0C0C0); ???????????????????????????
Thanks in Advance, Sharmi
|
| Tue Jan 24, 2012 11:52 pm |
|
 |
|
jason
Joined: Wed Jul 14, 2010 11:46 am Posts: 1396
|
 Re: How to set linear gradient property in Javascript
In JS you should be able to do: Code: controlText.style.PieBackground = "linear-gradient(#E9EDF6, #AABBDD)";
|
| Wed Jan 25, 2012 12:36 pm |
|
 |
|
Sharmi
Joined: Tue Jan 24, 2012 11:32 pm Posts: 2
|
 Re: How to set linear gradient property in Javascript
Thank u so much jason...It's working fine in IE...
|
| Fri Jan 27, 2012 12:34 am |
|
|
|
Page 1 of 1
|
[ 3 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 3 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|