jquery顏色選擇器:tinyColorPicker
tinyColorPicker是jquery實現快速可擴展靈活的支持移動和桌面的顏色選擇器。支持觸摸或手標響應,GPU加速渲染,豐富顏色模型及API。
$('.color').colorPicker({
color: ..., // see Colors...
customBG: '#FFF' // see Colors...
animationSpeed: 150, // toggle animation speed
GPU: true, // use transform: translate3d
doRender: true | 'selector', // manipulate color and bgColor of input field (on certain elements if selector)
opacity: true, // enable / disable alpha slider
renderCallback: function($elm, toggled) {}, // this === instance; $elm: the input field;toggle === true -> just appeared; false -> opposite; else -> is rendering on pointer move
// toggled true/false can for example be used to check if the $elm has a certain className and then hide alpha,...
buidCallback: function($elm) {}, // this === instance; $elm: the UI
css: '', // replaces existing css
cssAddon: '', // adds css to existing
margin: '', // positioning margin (can also be set in cssAddon)
scrollResize: true // toggle for reposition colorPicker on window.resize/scroll
gap: 4 // gap to right and bottom edge of view port if repositioned to fit
preventFocus: false // prevents default on focus of input fields (e.g. no keyboard on mobile)
body: document.body // the element where the events are attached to (touchstart, mousedown, pointerdown, focus, click, change)
});
本文由用戶 y37f 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!