多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 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> ``` ```