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 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!