AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Wheel color picker javascript library4/15/2024 ![]() ![]() '#123456').setColor() Sets the picker color to the given color in normalized HSL (0.1 scale). See above for the meaning of tColor(string) Sets the picker color to the given color in hex representation (e.g. linkTo(callback) Allows you to set a new callback. The optional callback argument behaves exactly as for the jQuery method. If you call $.farbtastic(placeholder) twice with the same placeholder, you will get the same object back each time. Note that there is only one Farbtastic object per placeholder. This allows you to use the Farbtastic methods and properties below. Invoking $.farbtastic(placeholder) is the same as using $(placeholder).farbtastic() except that the Farbtastic object is returned instead of the jQuery object. With color the chosen color in hex representation (e.g. DOM Node, jQuery object or jQuery selector: the color picker will be linked to the selected element(s) by syncing the value (for form elements) and color (all elements).įunction: this function will be called whenever the user chooses a different color.$(.).farbtastic(callback) This creates color pickers in the selected objects. ![]() Note that the black/white gradients inside wheel.png and mask.png were generated programmatically and cannot be recreated easily in an image editing program.Īdvanced Usage jQuery Method $(.).farbtastic() You can control the position by styling your placeholder (e.g. The color picker is a block-level element and is 195x195 pixels large. See demo1.html and demo2.html for an example (jquery.js is not included!). Include farbtastic.js and farbtastic.css in your HTML:Īdd a placeholder div and a text field to your HTML, and give each an ID:Īdd a ready() handler to the document which initializes the color picker and link it to the text field with the following syntax: ![]()
0 Comments
Read More
Leave a Reply. |