Question

does anybody know how to change the spiral gradient data of this percentage loader http://widgets.better2web.com/loader/ in order to change the colours of the gradient? For example instead of from orange to green I want from blue to red or whatever. I already created an issue on bitbucket:). but I never got an answer. I saw the outer and inner ring specification in the js-code in order to change the rest of the loader, but for the percentage spiral its "imgdata" that provides the colour. Could it be that it is a picture described as a bitcode?how can you create something like that?

Here is the example code. The imgdata code is acutally very long but I cut it, because its only numbers and characters:

/* Our spiral gradient data */
 var imgdata = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAIAAABMXPacAA[...]ZKAAAAAElFTkSuQmCC",
 gradient = new Image();
 gradient.src = imgdata;
Was it helpful?

OTHER TIPS

The gradient is hardcoded in the jQuery plug-in (look for "/* Create our linear gradient for the outer ring */" in this file : http://widgets.better2web.com/loader/loader/jquery.percentageloader-01a.js), and i don't see any options to set them on plug-in initialization (or even on runtime).

So the only way to change them is to modify javascript source (Author uses BSD license, so you're allowed to make modifications). As a notice, the project is hosted on bitBucket, and there's already an issue for gradient modifications : https://bitbucket.org/Better2Web/jquery.percentageloader/issues?status=new&status=open

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top