Forums
View unanswered posts | View active topics It is currently Wed May 22, 2013 11:32 am



Reply to topic  [ 3 posts ] 
 How to set linear gradient property in Javascript 
Author Message

Joined: Tue Jan 24, 2012 11:32 pm
Posts: 2
Post 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
Profile

Joined: Wed Jul 14, 2010 11:46 am
Posts: 1396
Post 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
Profile

Joined: Tue Jan 24, 2012 11:32 pm
Posts: 2
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.