Javascript 更改farbtastic颜色选择器的宽度对我不起作用
我真的很努力地改变了彩色选择器的宽度和高度,但没有成功。。。。JS不是我的语言 有人能帮帮我吗 我在html在线编辑器上尝试了所有可能的解决方案Javascript 更改farbtastic颜色选择器的宽度对我不起作用,javascript,jquery,css,farbtastic,Javascript,Jquery,Css,Farbtastic,我真的很努力地改变了彩色选择器的宽度和高度,但没有成功。。。。JS不是我的语言 有人能帮帮我吗 我在html在线编辑器上尝试了所有可能的解决方案 <!DOCTYPE html> <html> <head> <title>HTML5, CSS3 and JavaScript demo</title> <script type='text/javascript' src='https://ajax.googleapi
<!DOCTYPE html>
<html>
<head>
<title>HTML5, CSS3 and JavaScript demo</title>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.js'></script>
<script type='text/javascript' src='http://gilbertsincobh.com/wp-content/plugins/revslider/js/farbtastic/farbtastic.js'></script>
<link rel='stylesheet' href='http://gilbertsincobh.com/wp-content/plugins/revslider/js/farbtastic/farbtastic.css' type='text/css' />
<script type='text/javascript'>
$(document).ready(function(){
$('#demo').hide();
$('#picker').farbtastic('#color');
$.farbtastic("#picker", {callback: pickerUpdate, width: 600, height: 600});
function pickerUpdate(color){console.log("Color Picker Wheel: " + color);
}
);
</script>
</head>
<body>
<div id="picker"></div>
</body>
</html>
HTML5、CSS3和JavaScript演示
$(文档).ready(函数(){
$('#demo').hide();
$(“#picker”).farbtastic(“#color”);
$.farbtastic(#picker“,{回调:pickerUpdate,宽度:600,高度:600});
函数pickerUpdate(color){console.log(“颜色选择器轮:“+color”);
}
);
宽度和高度硬编码到插件源代码中。只需参考repo中的插件源代码。https://rawgit.com/mattfarina/farbtastic/master/src/farbtastic.js
这应该行得通
$(function () {
$('#colorpicker1').farbtastic('#color1');
$('#colorpicker2').farbtastic({ callback: '#color2', width: 150 });
});
你使用gilbertsincobh.com上的farbtastic有什么原因吗?似乎宽度和高度在js中是硬编码的。所以我刚刚使用了github repo上的farbtastic。但是它使用的是jquery的旧版本。谢谢你的回复。没有,没有理由使用特定的源代码。我没有想到,picker的大小是你的建议很有效,我现在就用它!