UNPKG

jqwidgets-scripts-custom

Version:

jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.

328 lines (325 loc) 16.2 kB
<!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href="../../Styles/jqx.apireference.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../scripts/documentation.js"></script> <meta name="keywords" content="jQuery, Button, Toggle Button, Repeat Button, Link Button, Help Documentation" /> <meta name="description" content="This page represents the help documentation of the jqxButton, jqxToggleButton, jqxRepeatButton and jqxLinkButton widgets." /> <title>jqxColorPicker</title> <script type="text/javascript"> $(document).ready(function () { $(".documentation-option-type-click").click(function (event) { $(event.target).parents('tr').next().find(".property-content").toggle(); }); }); </script> </head> <body> <div id="properties"> <h2 class="documentation-top-header">Properties</h2> <table class="documentation-table"> <tr> <th>Name </th> <th>Type </th> <th>Default </th> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span5'>colorMode</span> </td> <td> <span>String</span> </td> <td>'saturation' </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets the color mode. </p> <b>Possible Values:</b> <br /> <pre><code>'hue'</code></pre> <pre><code>'saturation'</code></pre> <h4>Code examples</h4> <p> Set the <code>colorMode</code> property. </p> <pre><code>$('#ColorPicker').jqxColorPicker({colorMode: 'hue' });</code></pre> <p> Get the <code>colorMode</code> property. </p> <pre><code>var colorMode = $('#jqxColorPicker').jqxColorPicker('colorMode');</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/ECqVg/">colorMode is set to 'hue'</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span2'>disabled</span> </td> <td> <span>Boolean</span> </td> <td>false </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Enables or disables the color picker. </p> <h4>Code examples</h4> <p> Set the <code>disabled</code> property. </p> <pre><code>$('#ColorPicker').jqxColorPicker({disabled: true });</code></pre> <p> Get the <code>disabled</code> property. </p> <pre><code>var disabled = $('#jqxColorPicker').jqxColorPicker('disabled');</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/LSE2c/">disabled is set to true</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span3'>height</span> </td> <td> <span>Number/String</span> </td> <td>null </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets the height of the color picker. </p> <h4>Code examples</h4> <p> Set the <code>height</code> property. </p> <pre><code>$('#ColorPicker').jqxColorPicker({height: 300 });</code></pre> <p> Get the <code>height</code> property. </p> <pre><code>var height = $('#jqxColorPicker').jqxColorPicker('height');</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/kGrJG/">height is set to 300</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span6'>showTransparent</span> </td> <td> <span>Boolean</span> </td> <td>false </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets the showTransparent property. </p> <h4>Code examples</h4> <p> Set the <code>showTransparent</code> property. </p> <pre><code>$('#ColorPicker').jqxColorPicker({showTransparent: true });</code></pre> <p> Get the <code>showTransparent</code> property. </p> <pre><code>var showTransparent = $('#jqxColorPicker').jqxColorPicker('showTransparent');</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/a43VE/">showTransparent is set to true</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span4'>width</span> </td> <td> <span>Number/String</span> </td> <td>null </td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets or gets the width of the color picker. </p> <h4>Code examples</h4> <p> Set the <code>width</code> property. </p> <pre><code>$('#ColorPicker').jqxColorPicker({width: 300 });</code></pre> <p> Get the <code>width</code> property. </p> <pre><code>var width = $('#jqxColorPicker').jqxColorPicker('width');</code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/GKXvL/">width is set to 300</a> </div> </div> </td> </tr> <tr> <td colspan='3' style='width: 100%'> <h2 class="documentation-top-header">Events</h2> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span27'>colorchange</span> </td> <td> <span>Event</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> This event is triggered when a new color is picked. </p> <h4>Code examples</h4> <p> Bind to the <code>colorchange</code> event by type: jqxColorPicker. </p> <pre><code>$('#jqxColorPicker').bind('colorchange', function (event) { var color = event.args; }); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/MPrJj/">Bind to the colorchange event by type:jqxColorPicker </a> </div> </div> </td> </tr> <tr> <td colspan='3' style='width: 100%'> <h2 class="documentation-top-header">Methods</h2> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span1'>getColor</span> </td> <td> <span>Method</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Gets the color. </p> <div class="methodArgs"> <table class="arguments"> <tbody> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> </tr> <tr> <td><em>None</em></td> <td></td> <td></td> </tr> </tbody> </table> <strong>Return Value</strong><br /> <em>Object</em> - object.hex - color as string. object.r, object.g, object.b - numbers from 0 to 255. </div> <h4>Code examples</h4> <p> Invoke the <code>getColor</code> method. </p> <pre><code>var color = $("#jqxColorPicker").jqxColorPicker('getColor'); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/cHD9a/">gets the color of the jqxColorPicker</a> </div> </div> </td> </tr> <tr> <td class="documentation-option-type-click"> <span id='Span37'>setColor</span> </td> <td> <span>Method</span> </td> <td></td> </tr> <tr> <td colspan='3' style='width: 100%'> <div class="documentation-option-description property-content" style="display: none;"> <p> Sets a color. </p> <div class="methodArgs"> <table class="arguments"> <tbody> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> </tr> <tr> <td><em>color</em></td> <td>Object/String</td> <td>hex color string or object with object.r, object.g, object.b number properties. Each property value should be from 0 to 255.</td> </tr> </tbody> </table> <strong>Return Value</strong><br /> <em>None</em> </div> <h4>Code examples</h4> <p> Invoke the <code>setColor</code> method. </p> <pre><code> $("#jqxColorPicker").jqxColorPicker('setColor', '#bbaaff'); or $("#jqxColorPicker").jqxColorPicker('setColor', {r: 150, g: 250, b: 255}); </code></pre> <div style="padding-bottom: 5px;"> <em>Try it:</em> <a target="_blank" href="http://jsfiddle.net/jqwidgets/g99La/">sets the color of the jqxColorPicker</a> </div> </div> </td> </tr> </table> <br /> </div> </body> </html>