如何称呼法拉斯特(颜色选择器) [英] How to call farbtastic (color picker)
问题描述
我使用了Farbastastic颜色选择器,为此我包括了所有文件,但是当我双击时如何命名这个颜色选择器?
I use the farbtastic color picker, I included all files for this, but how can I call this color picker when I double click?
这是我的.tpl文件中的占位符.我将其称为.</p>
That's my placeholder in my .tpl file. and I call it as follow.
// color picker selecteren.
$(function(){
$("#color").dbclick(function(){
$('#colorpicker').farbtastic('#color');
});
});
<!-- new color form -->
<form action="controller.php" method="post" class="popupform" id="form_changecolor">
<div id="colorpicker"></div>
<table>
<tr><th>huidige:</th><th>nieuwe:</th></tr>
<tr><td><input type="text" name="oldcolor" disabled="disabled" id="oldcolor" /></td><td><input type="text" name="newcolor" id="newcolor" /></td></tr>
</table>
<div class="buttonrow">
<input type="hidden" name="page" value="{$PAGE}" />
<input type="hidden" name="module" value="changecolor" />
<input type="hidden" name="id" id="parameter_key" value="" />
<input type="submit" class="btnOk" value="Aanpassen" />
<input type="button" class="btnCancel" value="Annuleren" />
</div>
</form>
@NeXXeus,我已经尝试过这样做(太大了,无法发表评论,并且在此问题的上下文中很有用):
@NeXXeus, I already try it to do so (too big for a comment, and useful in the context of this question):
这是我的.tpl文件中的占位符.我将其称为.</p>
That's my placeholder in my .tpl file. and I call it as follow.
// color picker selecteren.
$(function(){
$("#color").dbclick(function(){
$('#colorpicker').farbtastic('#color');
});
});
<!-- new color form -->
<form action="controller.php" method="post" class="popupform" id="form_changecolor">
<div id="colorpicker"></div>
<table>
<tr><th>huidige:</th><th>nieuwe:</th></tr>
<tr><td><input type="text" name="oldcolor" disabled="disabled" id="oldcolor" /></td><td><input type="text" name="newcolor" id="newcolor" /></td></tr>
</table>
<div class="buttonrow">
<input type="hidden" name="page" value="{$PAGE}" />
<input type="hidden" name="module" value="changecolor" />
<input type="hidden" name="id" id="parameter_key" value="" />
<input type="submit" class="btnOk" value="Aanpassen" />
<input type="button" class="btnCancel" value="Annuleren" />
</div>
</form>
推荐答案
You question isn't very clear, this page has a very nice description on setting it up: http://acko.net/dev/farbtastic
以此处的示例为基础,如果您只希望在双击该示例时将其变为彩色选择器...
Basing off of the example there, if you only want it to become a colorpicker when it is double-clicked...
$("#color").dblclick(function(){
$('#colorpicker').farbtastic('#color');
});
这篇关于如何称呼法拉斯特(颜色选择器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!