浏览文章
文章信息
Bootstrap colorpicker event changeColor | 颜色更改事件
439
示例:
<div id="background_color" class="input-group colorpicker-component">
<input type="text" id="input-background_color" name="background_color" value="#00AABB" class="form-control" />
<span class="input-group-addon"><i></i></span>
</div>
<script>
$(function() {
$('#background_color').colorpicker().on('changeColor',function (ev){
$('#preIFrame').contents().find("#top").css({background:$(this).colorpicker('getValue', '#ffffff')})
});
});
</script>