- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个模式窗口,显示一些数据,其中还包含在 Blueimp 库中打开的图像。我遇到的问题是,当在 BlueImp 画廊中打开图像时,图像没有在屏幕中间垂直对齐。它要么到底部,要么到顶部,这取决于我在模式窗口中滚动的位置。我需要转到模式窗口的中间并打开图库,在这种情况下灯箱看起来居中。当在没有模态的页面中直接使用 blueimp 时,不会发生此问题。看起来 blueimp 画廊的灯箱以整个模态高度为中心,而不是视口(viewport)高度。如何仅在模态窗口内覆盖 blueimp 的设置?当在 boostrap 模态中使用 blueimp 时,是否有 css 修复或 js 修复来覆盖此问题?
这是我的设置示例:
<div uib-modal-window="modal-window" class="modal fade" role="dialog" size="xl" index="0" animate="animate" ng-style="{'z-index': 1050 + $$topModalIndex*10, display: 'block'}" tabindex="-1" uib-modal-animation-class="fade" modal-in-class="in" modal-animation="true" style="z-index: 1050; display: block;">
<div class="modal-dialog modal-xl">
<div class="modal-content" uib-modal-transclude="">
<div class="lightBoxGallery">
<a ng-repeat="image in vm.ngModel" ng-href="{{::vm.imageurl(image.name)}}" data-gallery="">
<img ng-src="{{::vm.getImage(image.name)}}" class="img-responsive img-thumbnail animated fadeIn">
</a>
<div id="blueimp-gallery" class="blueimp-gallery">
<div class="slides"></div>
<h3 class="title"></h3>
<a class="prev">‹</a>
<a class="next">›</a>
<a class="close">×</a>
<a class="play-pause"></a>
<ol class="indicator"></ol> </div>
</div>
</div>
</div>
</div>
我的设置:Angular 1.5 + Bootstrap 3 + Bootstrap UI + BlueImp Gallery
更新:
我在这里遇到的问题是,我的 Bootstrap Modal 窗口有 overflow-y
为可滚动的,并且它有一个固定的位置:
.modal-open .modal {
overflow-x: hidden;
overflow-y: auto;
}
.modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
display: none;
overflow: hidden;
-webkit-overflow-scrolling: touch;
outline: 0;
}
当 blueimp-gallery
打开时,作为具有固定位置的子 div,它将 Div 定位到父固定位置的中心而不是视口(viewport)的中心:
.blueimp-gallery {
position: fixed;
z-index: 999999;
overflow: hidden;
background: #000;
background: rgba(0,0,0,.9);
opacity: 0;
display: none;
direction: ltr;
-ms-touch-action: none;
touch-action: none;
}
blueimp-gallery
与中间对齐,但我不希望它与父(模态)div 的中间对齐。我希望它与视口(viewport)的中间对齐。例如,在我的笔记本电脑中,我的模态框的高度为 2000 像素,而我的视口(viewport)高度远小于 860 像素。这就是为什么画廊灯箱会在视口(viewport)的顶部或底部打开,除非用户位于模式窗口的中间。如果我将 blueimp-gallery
直接放在正文中而不使用模态窗口,则不会出现此问题。但在这个用例中,我必须将 blueimp-gallery
放置在模态窗口内,该窗口的高度根据加载的动态内容而变化。
我仍然坚持这个问题,请问有人对这个问题有建议吗?
最佳答案
我能够解决此问题的唯一方法是将 "#blueimp-gallery"
元素从模态窗口中拉出,然后将其作为 的直接子元素再次插入body
元素。使用 Jquery,我添加了解决该问题的代码:
$(document).ready(function(){
$("#blueimp-gallery").prependTo($("body"));
});
现在,在上面的代码之后,BlueImp Gallery 的固定位置是相对于 body 元素的,因此高度是视口(viewport)的高度。模态高度不再影响 BlueImp Gallery 的高度,因为它现在被放置为 body
元素的直接子元素。
关于angularjs - Bootstrap Modal 内的 Blueimp Gallery 未正确垂直对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42711926/
我有 Angular 问题 modal service 我的 app.js 包括: angular.module('myApp', ['myApp.test', 'ui.bootstrap','sma
这是模态中模态的示例。 http://foundation.zurb.com/docs/components/reveal.html 关闭子模态后,有什么方法可以返回到相同状态的第一个模态吗?或者,更
我在另一个模态中有一个模态,我设法使内部模态关闭而不影响另一个模态。问题是,当第二个模态关闭时,它会为其自身和第一个模态触发 'hidden.bs.modal' 事件。 Open demo moda
我试图在单击跨度时打开 Bootstrap 模式对话框,我在互联网上搜索了问题的解决方案 Bootstrap 模式 $(...).modal 不是函数 但我发现的唯一解决方案是“将 jQuery 脚本
我收到错误:this.$modal.modal 不是一个函数 我通过 gulp 文件从 wwwroot 文件夹中的 Node_Module 获得了 ng2-bs3-modal。 我的文件夹结构是:
我使用“use-ajax”类在模态中呈现登录表单。我想在不关闭同一模式的情况下处理验证错误。成功登录后,它会正确重定向,但是当发生错误时,它会关闭模式并重定向到登录页面,即用户/登录并在该页面上显示错
我使用的是 5.2.9 版的 Angular 5,我使用的是 ngx-smart-modal,当我打开 Modal 时,它不显示内容并且非常接近顶部并缩小,附加的图像已附加。 const reason
我正在尝试显示模式弹出窗口以显示网格中所选记录的详细信息。在模式弹出窗口中设置每个控件的值后,我尝试打开它但失败。我已在网站母版页中包含了所有必需的引用,但不断收到“对象不支持属性或方法‘模态’”错误
我正在关注这个Tutorial . 这是我的代码(我已经排除了我的表格 HTML): @model IEnumerable @{ Layout = "~/Views/Shared/_Layou
使用 twitter bootstrap 框架进行 Web 应用程序。我正在使用一个模态,其中我调用另一个模态,其中一个模态位于另一个模态之上。目前,如果您单击关闭“x”按钮,它将关闭两个模式窗口。我
是否可以使用 Twitter Bootstrap 在另一个模态中打开一个模态? 我创建了一个模态,并在第一个模态体内放置了一个指向第二个模态的链接和第二个模态的定义。当我单击链接时,第二个模式在第一个
我正在尝试将 Angular 的 Bootstrap 模式传递给在 Angular Masonry Gallery 中单击的图像的 URL。我所拥有的与文档中的演示非常接近,仅做了一些更改。我知道这完
我需要解决这个问题,我的问题是您看到的第一个模态框必须在白色模态框的后面,我该如何更改它们的位置? 这是图片 黑色模态应该在后面,白色模态应该在前面我怎样才能做到这一点?请帮忙谢谢。 这是我专门制作的
我在 Bootstrap 中遇到这些模态问题。我已经为两者设置了不同的 id,但是当按下“更多”按钮时只有第一个出现。第二个按钮没有显示所需的模式。 Something The Team
被这个问题难住了,但也许,只是也许,有人以前遇到过这个问题,可以给我指出正确的方向。 我有一个 JDialog 用于显示长时间运行的任务的进度,我已将其明确创建为具有定义的所有者的模式: prog
我有一个使用 PrimeFaces 3.0.1 在模态对话框上显示的模态 ConfirmDialog。如果 ConfirmDialog 被打开,整个页面都会被锁定,包括 ConfirmDialog 本
因此,我使用这段代码在当前打开的模态窗口中打开另一个模态窗口: Click 发生的情况是,滚动条会重复 500 毫秒。我猜是因为当前模式仍在淡出。然而,它看起来非常不平滑和卡顿。 如果有任何解决此问题
我目前在 Angular 应用程序中使用自定义主题,我需要将一个额外的 css 类附加到“.modal-dialog”容器,它位于 ngb-modal 内部-窗口。 根据文档 (https://ng-
我关注了这个 StackBlitz example加你 ngx-smart-modal window 。 一切都很顺利,除了组件在页面上打开而不是在灯箱模式弹出窗口中打开。 此示例使用 Angular
我想用 bunit 测试模态是否打开。问题是,模态没有被渲染。如何用 bunit 打开一个 blazored modal? 在我的测试组件中创建模态: Hi
我是一名优秀的程序员,十分优秀!