Bootstrap 颜色选择器不工作

Bootstrap colorpicker doesn't work

Bootstrap 颜色选择器不起作用。这是我的代码

 <div class="form-group"style="margin-top:-10px">
   <label style=" height:20px !important ;font-size: 12px;" class="col-sm-4 
    control-label">Kurye Durum Renk</label>
   <div class="col-sm-7">
      <input id="ColorPickerKuryeDurumRenk" type="text" class="form-control">
   </div>
 </div>


<link rel="stylesheet" src="plugins/colorpicker/bootstrap-colorpicker.min.css">
<script src="plugins/colorpicker/bootstrap-colorpicker.min.js"></script>

<script>

    $(document).ready(function(){

        $("#ColorPickerKuryeDurumRenk").colorpicker();
    });

</script>

当我运行这样的代码时,我没有收到任何错误,但颜色选择器不起作用。我的失败在哪里?

<link rel="stylesheet" src="plugins/colorpicker/bootstrap-colorpicker.min.css">

要导入样式表,您需要使用 href="PATH_OF_FILE"

很确定是你的 lib 路径错误或引用不正确。

尝试使用以下内容,如果它有效,那么您可以 调试 通过一个一个地删除它们(并改用您的本地引用)

<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.5.1/css/bootstrap-colorpicker.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.5.1/js/bootstrap-colorpicker.min.js"></script>

<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.5.1/css/bootstrap-colorpicker.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.5.1/js/bootstrap-colorpicker.min.js"></script>

<div class="form-group"style="margin-top:-10px">
   <label style=" height:20px !important ;font-size: 12px;" class="col-sm-4 
    control-label">Kurye Durum Renk</label>
   <div class="col-sm-7">
      <input id="ColorPickerKuryeDurumRenk" type="text" class="form-control">
   </div>
 </div>


<link rel="stylesheet" src="plugins/colorpicker/bootstrap-colorpicker.min.css">
<script src="plugins/colorpicker/bootstrap-colorpicker.min.js"></script>

<script>
    $(document).ready(function(){
        $("#ColorPickerKuryeDurumRenk").colorpicker();
    });
</script>