我在我的项目中使用jquery旋钮来设置一些参数的值。但是,我看不到jquery旋钮中心的输入值。我在jsfiddle中尝试过它,它可以工作,但是如果我在我的代码中使用它,同样的事情也不能工作。我不确定我哪里错了?有没有人能提个建议?
jsFiddle链接:http://jsfiddle.net/pljsf/RJY3N/
HTML:
<script src='https://raw.github.com/aterrien/jQuery-Knob/master/js/jquery.knob.js'></script>
<input type="text" value="55" class="dial">下面的JavaScript:
$('document').ready(function() {
var dialColor = 'blue';
var dialValue = $('.dial').val() ;
$(".dial").knob({
'width':"200",
'height':"200",
'min' : "50",
'max' : "110",
'thickness':.3,
'fgColor':dialColor,
'tickColorizeValues': true,
'dynamicDraw': true,
'displayInput': true,
"skin":"tron",
'inputColor' : "#ff0000",
//'change' : function(dialValue) { $('.dial').val(dialValue); }
});
$('.dial').val(dialValue).trigger('change');
}); (我搜索的解决方案都不适合我。:( )
谢谢
发布于 2015-05-12 18:18:34
问题是你的knobjs包含,你直接从github包含它,浏览器拒绝它,因为它的mime类型不同。尝试包含来自其他来源的内容,它将工作得很好。永远不要在你的页面中直接包含来自github的JS。github不是CDN。
https://stackoverflow.com/questions/22210683
复制相似问题