ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# bootstrap3 中文文档<https://v3.bootcss.com/> <https://cdn.bootcss.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css> <https://cdn.bootcss.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js> 以下代码解决模态框相互调用bug ``` <pre class="calibre16">``` $<span class="token2">(</span>document<span class="token2">)</span><span class="token2">.</span><span class="token1">ready</span><span class="token2">(</span><span class="token5">function</span><span class="token2">(</span><span class="token2">)</span> <span class="token2">{</span> $<span class="token2">(</span>document<span class="token2">)</span><span class="token2">.</span><span class="token1">on</span><span class="token2">(</span><span class="token4">'show.bs.modal'</span><span class="token2">,</span> <span class="token4">'.modal'</span><span class="token2">,</span> <span class="token5">function</span><span class="token2">(</span><span class="token2">)</span> <span class="token2">{</span> var zIndex <span class="token">=</span> <span class="token3">1040</span> <span class="token">+</span> <span class="token2">(</span><span class="token3">10</span> <span class="token">*</span> $<span class="token2">(</span><span class="token4">'.modal:visible'</span><span class="token2">)</span><span class="token2">.</span>length<span class="token2">)</span><span class="token2">;</span> $<span class="token2">(</span>this<span class="token2">)</span><span class="token2">.</span><span class="token1">css</span><span class="token2">(</span><span class="token4">'z-index'</span><span class="token2">,</span> zIndex<span class="token2">)</span><span class="token2">;</span> <span class="token1">setTimeout</span><span class="token2">(</span><span class="token5">function</span><span class="token2">(</span><span class="token2">)</span> <span class="token2">{</span> $<span class="token2">(</span><span class="token4">'.modal-backdrop'</span><span class="token2">)</span><span class="token2">.</span><span class="token1">not</span><span class="token2">(</span><span class="token4">'.modal-stack'</span><span class="token2">)</span><span class="token2">.</span><span class="token1">css</span><span class="token2">(</span><span class="token4">'z-index'</span><span class="token2">,</span> zIndex <span class="token">-</span> <span class="token3">1</span><span class="token2">)</span><span class="token2">.</span><span class="token1">addClass</span><span class="token2">(</span><span class="token4">'modal-stack'</span><span class="token2">)</span><span class="token2">;</span> <span class="token2">}</span><span class="token2">,</span> <span class="token3">0</span><span class="token2">)</span><span class="token2">;</span> <span class="token2">}</span><span class="token2">)</span><span class="token2">;</span> <span class="token2">}</span><span class="token2">)</span><span class="token2">;</span> ``` ```