Most people use Modal within a Dialog (it appears in front of the rest of the page). Is it possible to have a div that appears via slideToggle() and is then modal but still inline with the rest of the page?
大多数人在对话框中使用Modal(它出现在页面的其余部分之前)。是否有可能通过slideToggle()出现一个div然后是模态但仍然与页面的其余部分内联?
This shows the general idea
这显示了一般的想法
http://jsfiddle.net/55wwaw05/1/
When you click the red button it slideToggles a div which should be modal, only the blue button should be clickable and when it is clicked the modal div disappears.
当你点击红色按钮时,它会滑动一个应该是模态的div,只有蓝色按钮应该是可点击的,当它被点击时,模态div就会消失。
ignore this
$('#btn').click(function() {
$('#first').slideToggle(100);
$('#second').css("background-color","grey");
$('#btn').attr("disabled", true);
1 个解决方案
#1
0
Use the modal with one of the inline-block classes that matches the desired screen size:
将模态与其中一个与所需屏幕大小匹配的内联块类使用:
- .visible-xs-inline-block
- .visible-sm-inline-block
- .visible-md-inline-block
- .visible-lg-inline-block
References
- Bootstrap: Responsive Utilities
Bootstrap:响应式工具
#1
0
Use the modal with one of the inline-block classes that matches the desired screen size:
将模态与其中一个与所需屏幕大小匹配的内联块类使用:
- .visible-xs-inline-block
- .visible-sm-inline-block
- .visible-md-inline-block
- .visible-lg-inline-block
References
- Bootstrap: Responsive Utilities
Bootstrap:响应式工具