Fórum
Pre-set color to AUI colorpicker
Mk Sin, modificado 11 Anos atrás.
Pre-set color to AUI colorpicker
Junior Member Postagens: 74 Data de Entrada: 25/05/12 Postagens Recentes
http://www.liferay.com/community/liferay-projects/alloy-ui/demo?title=community-liferay-projects-alloy-ui-demos-color-picker
Following that link, i know how to use colorpicker, and it work fine, but...
I dont know how to pre-set color in the picker( when click on the picker, colorpicker popup open with no color preset, the next times it will open with lastest color you picked)
Anybody can help me plz
Following that link, i know how to use colorpicker, and it work fine, but...
I dont know how to pre-set color in the picker( when click on the picker, colorpicker popup open with no color preset, the next times it will open with lastest color you picked)
Anybody can help me plz
Yaroslav Rudyy, modificado 11 Anos atrás.
RE: Pre-set color to AUI colorpicker
New Member Postagens: 2 Data de Entrada: 02/03/11 Postagens RecentesMk Sin:
http://www.liferay.com/community/liferay-projects/alloy-ui/demo?title=community-liferay-projects-alloy-ui-demos-color-picker
Following that link, i know how to use colorpicker, and it work fine, but...
I dont know how to pre-set color in the picker( when click on the picker, colorpicker popup open with no color preset, the next times it will open with lastest color you picked)
Anybody can help me plz
<aui:script use="aui-color-picker">
AUI().ready('aui-color-picker-base', function(A) {
var colorNode = A.one('#color');
window.colorPicker = new A.ColorPicker({
hex: colorNode.text(),
after: {
colorChange: function(val) {
var hex = '#' + this.get('hex');
colorNode.setContent('color: ' + hex);
colorNode.setStyle('backgroundColor', hex);
}
}
}).render('#demo');
});
</aui:script>