簡體   English   中英

Colorpicker在Bootstrap Popover內部不起作用

[英]Colorpicker is not working inside the bootstrap popover

我有一個帶有內部2個選項卡的bootstrap popover,第一個選項卡上的用戶可以上傳圖像,第二個選項卡上的用戶可以使用colorpicker選擇顏色,該彈出框有效,而該彈出框內的各個選項卡有效,但是colorpicker無效正在准備文檔,

jQuery的

$('.specular_color').colpick({
flat:true,
layout:'hex',
submit:0,
onChange:function(hsb,hex,rgb,el,bySetColor) 
{   
$('.specular_color').css('border-color','#'+hex);
specularmap_color='#'+hex;
specularmap_texture="";
$(".specular_img").css("display","none");
$( ".specular_img" ).parent().css("background-color",'#'+hex);
specular_color=hex;
meshphong.specular=increase_brightness(specular_color, 0);
load_meshphong();
}
});
$('.emission_color').colpick({
flat:true,
layout:'hex',
submit:0,
onChange:function(hsb,hex,rgb,el,bySetColor) 
{   
$('.emission_color').css('border-color','#'+hex);
specularmap_color='#'+hex;
specularmap_texture="";
$(".specular_img").css("display","none");
$( ".specular_img" ).parent().css("background-color",'#'+hex);
emission_color=hex;
meshphong.emissive=increase_brightness(emission_color, 0);
load_meshphong();
}
});

HTML:

<div class="tabbable hide" id="specular_popover">
<ul class="nav nav-tabs clsacc_Tab">
<li class="active"><a href=".specular1" data-toggle="tab">Texture</a></li>
<li class="tab"><a href=".specular2" data-toggle="tab">Color</a></li>
</ul>
<div class="tab-content" style="padding-top: 15px">
<div class="tab-pane active specular1" >
<div class="children">
<div class="widget button-widget">
<button class="btn btn-primary" data-toggle="modal" data-target="#textures_modal">Manage textures</button>
</div>
<?php 
if($textures=get_data('mv_textures',array('user_id'=>user_id()))->result())
{
?>
<select name="specular1textures" class="form-control">
<?php
$cnt=0; 
foreach($textures as $row)
{
$cnt++;?>
<option value="<?php echo $row->textures_file?>">
<?php  if(!$row->textures_file) echo'Material '.$cnt.': ';else echo $row->textures_file;?>
</option>
<?php 
}
?>
</select>
<?php 
}?>
</div>
</div>
<div class="tab-pane specular2">
<div class="panel-body specular_color" id=""></div>
</div>
</div>
</div>

和帶有標簽的彈出框示例

例如小提琴是: 小提琴

如果您在顏色選擇器之后啟動彈出窗口,它將起作用。

$('.specular_color').colpick({
    flat:true,
    layout:'hex',
    submit:0,
 });

 $(".specular_popover_trigger").popover({html: true,trigger:"click",placement:      "bottom",content: $('#specular_popover').html()});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM