问题在 IE 中正确实现 Colorbox(所有版本)

2023-06-21前端开发问题
13

本文介绍了问题在 IE 中正确实现 Colorbox(所有版本)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我一直在竭尽全力(并在规定的时间内)试图找出 Colorbox 在以下页面上无法正常工作的原因:[链接已删除]

I've been pulling my hair out (and going way over allotted hours) to try and figure out why Colorbox isn't working properly on the following page: [link removed]

我在右下角设置了一个彩盒测试链接,上面写着Web Design By All Web Cafe",它应该会打开一个小的徽标图像.在 Firefox、Safari 等中,模式的行为应有尽有,在所有现有页面内容之上打开中心中心.在 IE 中,不仅模式不居中,而且看起来好像它不服从绝对定位并将所有现有的页面内容推到下方.再加上它没有以正确的大小打开并在模态图像旁边创建滚动条这一事实,我们自己有一个丑陋的模态.

I've set up a Colorbox test link on the very bottom right that says "Web Design By All Web Cafe", which should open up a small logo image. In Firefox, Safari, etc the modal behaves as it should, opening center center above all of the existing on-page content. In IE, not only is the modal not centered, but it appears as though it's not obeying absolute positioning and pushing all of the existing on-page content down below. Add to that the fact that it's not opening to the correct size and creating scrollbars next to the modal image, and we have ourselves one ugly modal.

我可以使用的滚动条(只需调整模态的最小高度),但我不知道为什么它不会居中.让我说我最初并没有为这个网站编写代码,而且它是在几年前完成的,所以很可能有很多 CSS hack 可以让内容正确显示,其中任何数量都可能导致这个问题.

The scrollbars I can live with (by just resizing the min-height of the modal), but I can't figure out why it won't center. Let me say that I did not code this site initially and it was completed quite a few years ago, so there are quite probably numerous CSS hacks to get things to display properly, any number of which may be causing this problem.

相比之下,Thickbox 也在此站点上设置(如果您单击深蓝色区域中的播放视频"标注)并且行为正确,但存在一些奇怪的尺寸/填充问题,因此希望更换它带有一些更现代和可扩展的东西.我可以验证这两个模态脚本/CSS 文件同时存在没有冲突,因为即使完全删除了Thickbox,Colorbox 仍然存在问题.

By contrast, Thickbox is also set up on this site (if you click on the "Play Video" callout in the dark blue area) and behaves correctly, though suffers from some weird sizing/padding issues, hence the desire to replace it with something a bit more modern and extensible. I can verify that there is no conflict having both of these modal scripts/CSS files concurrently as the problem still occurs with Colorbox even when Thickbox is removed entirely.

任何想法或建议将不胜感激.

Any thoughts or suggestions would be greatly appreciated.

推荐答案

知道了!!!..在我的代码中修改了很多东西(有同样的问题)......

GOT IT!!! .. after modifying A LOT of things in my code (had the same issue) ...

简单地说:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

.. 在页面的开头.它必须在包含或其他所有内容之前.

.. at the very begining of your page. It has to be BEFORE includes or everything else.

希望这会有所帮助.干杯!

Hope this helps. Cheers!

马里亚诺.

这篇关于问题在 IE 中正确实现 Colorbox(所有版本)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

Fatal error: Call to a member function fetch_assoc() on a no
业务场景:使用update语句去更新数据库字段。 原因:update接收值不正确。原来代码: $query = "UPDATE student SET date = now() WHERE id = $id";$result = $mysqli-query($query2) or die($mysqli-error); // 问题出现了在这句 $data = $result-fetch_ass...
2024-12-13 前端开发问题
136

layui实现laydate日历控件控制之前日期不可选择
具体实现代码如下: laydate.render({ elem: '#start_time', min:0, //,type: 'date' //默认,可不填}); 只要加一个min参数,就可以控制了。0表示之前的日期不可...
2024-11-29 前端开发问题
133

ajax请求获取json数据并处理的实例代码
ajax请求获取json数据并处理的实例代码 $.ajax({ type: 'GET', url: 'https://localhost:44369/UserInfo/EditUserJson',//请求数据 data: json,//传递数据 //dataType:'json/text',//预计服务器返回的类型 timeout: 3000,//请求超时的时间 //回调函数传参 suc...
2024-11-22 前端开发问题
215

layui 实现实时刷新一个外部的div
主页面上显示了一个合计,在删除和增加的时候需要更改这个总套数的值: //html代码div class="layui-inline layui-show-xs-block" style="margin-left: 10px" id="sumDiv"spanSOP合计:/spanspan${totalNum}/spanspan套/span/div 于是在我们删除这个条数据后,...
2024-11-14 前端开发问题
156

layui 单选框、复选框、下拉菜单不显示问题如何解决?
1. 如果是ajax嵌套了 页面, 请确保 只有最外层的页面引入了layui.css 和 layui.js ,内层页面 切记不要再次引入 2. 具体代码如下 layui.use(['form', 'upload'], function(){ var form = layui.form; form.render(); // 加入这一句});...
2024-11-09 前端开发问题
313

layui laydate日期时间范围,时间默认设定为23:59:59
在Layui中,如果你想设置日期时间选择器(datetime)的默认结束时间为当天的23:59:59,你可以使用如下代码: laydate.render({ elem: '#test10' ,type: 'datetime' ,range: true ,max: '{:date("Y-m-d 23:59:59")}' ,ready: function(date){ $(".layui-laydat...
2024-10-24 前端开发问题
279