久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

bootstrap:僅針對特定模態更改模態背景不透明度

bootstrap: change modal backdrop opacity only for specific modals(bootstrap:僅針對特定模態更改模態背景不透明度)
本文介紹了bootstrap:僅針對特定模態更改模態背景不透明度的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個包含多個模式的菜單.當我打開一個在另一個上時,它會將背景變成黑色,這很難看.我知道我需要更改 filter: alpha(opacity=80); in .modal-backdrop.fade.in in bootstrap.css.但我需要更改它不是針對所有模態,僅針對其中一些模態.這是第一個模態的html代碼

I have a menu with multiple modals. When I open one over another it turns backgrount into black, which is ugly. I understand that I need change filter: alpha(opacity=80); in .modal-backdrop.fade.in in bootstrap.css. But I need to change it not for all modals, only for some of them. Here's the html code for first modal

    <div class="modal hide" id="mbusModal">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">×</button>
            <h3>MBUS</h3>
        </div>
        <div class="modal-body">
            <form class="form-horizontal">
                <form class="well form-inline">
                    <input type="button" class="btn" onclick="$('#dinMbusModal').modal('show'); $('#tabsMbusDin a:last').tab('show');" value="din">
                </form>
            </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">Закрыть</a>
            <a href="#" class="btn btn-primary" onclick="addPort('mbus',$('#mbusDev').val(),$('#mbusSpeed').val()); $('#mbusModal').modal('hide')">Применить</a>
        </div>

這個模態需要改變他的背景:

This modal needs to change his backdrop:

    <div class="modal hide" id="dinMbusModal" style="width: 500px; margin: -250px 0 0 -250px;">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">×</button>
            <h3>DIN</h3>
        </div>
        <div class="modal-body">
        </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">Закрыть</a>
            <a href="#" class="btn btn-primary" onclick="addPort('din_mbus',,); $('#dinMbusModal').modal('hide')">Применить</a>
        </div>
    </div>

推薦答案

背景是由 Modal 插件動態生成的,這有點復雜.一種可能的方法是在收到 show 事件時向 body 添加一個類,然后在 hidden 上將其刪除.

Little bit complicated by the fact that the backdrop is generated by the Modal plugin on the fly. One possible way of doing it is adding a class to the body when you get a show event, then remove it on the hidden.

類似:

.modal-color-red .modal-backdrop {
  background-color: #f00;
}
.modal-color-green .modal-backdrop {
  background-color: #0f0;
}
.modal-color-blue .modal-backdrop {
  background-color: #00f;
}

JS

$('.modal[data-color]').on('show hidden', function () {
  $('body').toggleClass('modal-color-'+ $(this).data('color'));
});

HTML

<div class="modal hide fade" id="redModal" data-color="red">...</div>
<div class="modal hide fade" id="greenModal" data-color="green">...</div>
<div class="modal hide fade" id="blueModal" data-color="blue">...</div>

這篇關于bootstrap:僅針對特定模態更改模態背景不透明度的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

jQuery/JavaScript Library for avatar creation?(用于創建頭像的 jQuery/JavaScript 庫?)
How to do following mask input problem?(如何做以下掩碼輸入問題?)
Issues Setting Value/Label Using DropKick Javascript(使用 DropKick Javascript 設置值/標簽的問題)
how to unit-test private methods in jquery plugins?(如何對 jquery 插件中的私有方法進行單元測試?)
stellar.js - configuring offsets / aligning elements for a vertical scrolling website?(stellar.js - 為垂直滾動網站配置偏移量/對齊元素?)
jQuery masked input plugin. select all content when textbox receives focus(jQuery 屏蔽輸入插件.當文本框獲得焦點時選擇所有內容)
主站蜘蛛池模板: 成人教育av | 欧美久久一区二区三区 | 性色视频| 色婷婷综合久久久中字幕精品久久 | www.五月天婷婷.com | 小h片免费观看久久久久 | 亚洲国产成人精品久久久国产成人一区 | 欧日韩在线 | 特黄视频| 亚洲一区二区三区在线 | 日韩高清一区 | 青青操av| 国产美女一区 | 色吊丝2288sds中文字幕 | 成年免费大片黄在线观看岛国 | 精品欧美一区二区中文字幕视频 | 国产视频福利在线观看 | 亚洲成人精选 | 日韩第一区 | 国产精品无码专区在线观看 | 国产在线播放av | 久久久久亚洲精品 | 国产亚洲精品久久yy50 | 免费看国产一级特黄aaaa大片 | 亚洲国产成人精品久久久国产成人一区 | 精品欧美一区免费观看α√ | 综合久久av | 国产激情在线看 | 午夜精品一区二区三区免费视频 | 九一在线观看 | 鸡毛片| 在线 丝袜 欧美 日韩 制服 | 日韩久久久久久久 | 国产精品福利网站 | h在线免费观看 | 中文字幕在线精品 | 亚洲国产精品久久人人爱 | 久久久久久久久久久爱 | 久久久精品一区 | 在线观看中文字幕一区二区 | 有码一区 |