最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Why does this jQuery color picker fail within a Bootstrap modal? - Stack Overflow

programmeradmin1浏览0评论

I'm using the excellent jQuery color picker from

It works correctly under "normal" circumstances but doesn't show the picker when the input parent element is found within a Bootstrap 3 modal.

This works:

<div class="container">
  <div class="row">
    <div class="col-md-6">
        <input type="text" id="colorPick1" class="colorPick"/>
    </div>
  </div>
</div>

But the same thing inside a Bootstrap modal fails to show the picker:

<div class="modal-body">
    <div class="row">
        <div class="col-md-6">
            <input type="text" id="colorPick2" class="colorPick"/>
        </div>
    </div>
</div>

Is there a way to use this color picker within a Bootstrap modal?

Thanks

I'm using the excellent jQuery color picker from http://colpick./plugin

It works correctly under "normal" circumstances but doesn't show the picker when the input parent element is found within a Bootstrap 3 modal.

This works:

<div class="container">
  <div class="row">
    <div class="col-md-6">
        <input type="text" id="colorPick1" class="colorPick"/>
    </div>
  </div>
</div>

But the same thing inside a Bootstrap modal fails to show the picker:

<div class="modal-body">
    <div class="row">
        <div class="col-md-6">
            <input type="text" id="colorPick2" class="colorPick"/>
        </div>
    </div>
</div>

Is there a way to use this color picker within a Bootstrap modal?

Thanks

Share Improve this question edited Feb 20, 2018 at 12:11 Stephen Lead asked Nov 11, 2013 at 4:14 Stephen LeadStephen Lead 1,9765 gold badges26 silver badges49 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

The problem is z-index just add this line in your css class it works good..

.colpick {
  z-index: 9999;
}

Jsfiddle DEMO

发布评论

评论列表(0)

  1. 暂无评论