jPicker change color transparent + get object
I'm using jPicker,I have 2 Questions.
1.How can I change the color to the transparent one? Already tried using
$.jPicker.List[0].color.acive.val('hex','FFFFFF',this)
-> Found this , not sure if the best solution $.jPicker.List[0].color.acive.val('ahex','00000000',this)
2.Other is how can ac开发者_开发问答cess without using the "index", like a selector.
For example something like:
$('selector').color.active.val('hex','FFFFFF',this) -> just an idea
this is Chris Tillman, and I kinda (completely) wrote the plugin you're using. To accomplish the first question, just run
$.jPicker.List[0].color.active.val('a', 0, this);
That will set just the alpha value for the active color.
If you want to get to the DOM element without using the List, just set it equal to a variable at instantiation like so.
var MyPicker = $('selector').jPicker()[0];
Just remember the index location at the end as the jPicker ALWAYS returns the result of $('selector').each(). If you are using one selector call for three different pickers, you can forget the index call at the end and get to each on using MyPicker[0], MyPicker[1], MyPicker[2] ... The $.jPicker.List[] is a master collection list for ALL instances of the picker, where this solution will ONLY index the pickers created by that individual call.
This method is a bit more complicated but you can check this answer to get the actuall ID
https://stackoverflow.com/a/27445752/2307326
精彩评论