Check out this jquery library called Backgroundor , I wrote it myself.
It's that simple just enter $('#divId').backgroundor(); and it will work, there are also many options in it. check them out:
// the values here are the default values options = { opacityval : 0; // int, only 1 or 0 are accepted now (can be boolean too) intervaltime : 100; // int, interval time value values : [0,51,75]; // array of int, default percentage values for the linear gradient colors colors : ['#499bea','#207ce5','#1679e3']; // array of string (hex values), default colors for the linear gradient color : '#000000'; // string (hex value), default color for opacity animation animspeed : 'linear'; // string, default animation curve animdegree : '90deg'; // string, default linear-gradient degree }
Khaled Al-Ansari
source share