大家好!
我试图实现一些方法,让我们的客户自定义他们的网站(我们的模板),实际上我正在尝试插入一个颜色选择器到html。
好的,我们通过两种形式:
-定制海德尔bg
自定义页脚-->背景
--->文本颜色
请问我该怎么做有什么建议吗?我读到了,但我不能实现它,我不知道从哪里开始。
我更喜欢使用一个颜色选择器,让用户能够通过HEX-also和rgba(另外,不需要)插入颜色,因为也许我们的客户必须在logo或其他东西中使用HEX代码,让他们感到非常舒服。
谢谢!
PS:对不起我的英国人,祝你们今天愉快。
jsfiddle:https://jsfiddle.net/g7zhtfh5/embedded/result/
<h4>Personalización de los colores</h4>
<br/>
<h5>Cabecera</h5>
<form name='formServicioRemoteApps-header-bgcolor' id='formServicioRemoteApps-header-bgcolor' role="form" method='post' enctype="multipart/form-data" action='' accept-charset='utf-8'>
<!-- Seccion para personalizar los colores del header -->
<div class="form-group seccion-header-bgcolor">
<label>
Color del fondo: <button>poner picker color</button>
</label>
<div class="form-group clearfix">
<div class="pull-right">
<input type="hidden" id="tokenForm_imagenes" name="tokenForm" value="<?php echo $this->tokenForm; ?>">
<input type="hidden" id="idSite_imagenes" name="idSite" value="<?php echo $this->infoSite_mysql[0]->id ?>">
<button type="submit" class="btn btn-primary"><?php echo $this->traduccion['boton_aceptar']; ?></button>
</div>
</div>
</div>
</form>
<h5>Pie de página</h5>
<form name='formServicioRemoteApps-footer-bgcolor' id='formServicioRemoteApps-footer-bgcolor' role="form" method='post' enctype="multipart/form-data" action='' accept-charset='utf-8'>
<!-- Seccion para personalizar los colores del footer -->
<div class="form-group seccion-footer-bgcolor">
<label>
Color del fondo: <button>poner picker color</button>
</label><br>
<label>
Color del fondo: <button>poner picker color</button>
</label>
<div class="form-group clearfix">
<div class="pull-right">
<input type="hidden" id="tokenForm_imagenes" name="tokenForm" value="<?php echo $this->tokenForm; ?>">
<input type="hidden" id="idSite_imagenes" name="idSite" value="<?php echo $this->infoSite_mysql[0]->id ?>">
<button type="submit" class="btn btn-primary"><?php echo $this->traduccion['boton_aceptar']; ?></button>
</div>
</div>
</div>
</form>
最佳答案
尝试查看farbtastic
在获得javascript和css文件之后,就很容易实现了。
<script type="text/javascript" src="/js/farbtastic.js"></script>
<script type="text/javascript">
$(document).ready(function () {
//alert(1);
debugger;
$('#colorpicker').farbtastic('#id');
});
</script>
<input type='TextBox' ID="_tbColor"value="#123456"/>
<div id="colorpicker"></div>
关于javascript - 如何使用JQuery将选色器插入html,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34295017/