javascript - 在 IE 中滚动颜色框

标签 javascript jquery css colorbox

我正在使用 ColorBox's Ajax 模式。

<a class='data-content' href='data/<?=$id?>'> <img src=uploads/thumb_<?=$img?> /> </a>

     <script type="text/javascript"> 

      $(document).ready(function(){

        $(".data-content").colorbox({
              transition: "none",
              title: false,
              width: "700px",
              top: "10px",
              loop: false,
              scrolling: false
        });

      });

     </script>

单击照片缩略图后,它会加载带有照片和其他内容的颜色框。通常它的高度大于屏幕。所以滚动条出现了。使用其他浏览器(Mozilla、Chrome),我可以上下滚动并毫无问题地查看框中的所有内容。

当使用 IE8 滚动时,颜色框停留在同一个地方,而不是背景滚动。所以我看不到所有内容。

这是一个 example .实际上它是默认的 Colorbox 示例。

关于可能导致问题的任何想法?

最佳答案

可能是这个...来自网站 - http://colorpowered.com/colorbox/#doctype

ColorBox requires a valid doctype and rendering in quirks mode is not supported. If you aren't using the HTML5 doctype, make sure you are using the full doctype declaration (with URI) to insure rendering in standards mode.

Unfortunately, this abbreviated doctype renders the document in quirks mode for Internet Explorer:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

The doctype with URI renders in standards mode for all browsers:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

关于javascript - 在 IE 中滚动颜色框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6213924/

相关文章:

javascript - 如何获取变量的字面名称?

javascript - 如何在 ReactJS 中创建和应用基于 CSS 类的动态样式表?

javascript - ion-view 没有出现在 ion-nav-view 中

jquery - 结合 2 个不同的计数代码来创建一个特定的结果

javascript - HTML + JS + CSS 转换器

javascript - 如何从javascript中的去抖动函数返回值?

javascript - 如何在 ng-blur 中将输入元素作为参数传递?

javascript - 按下按钮时检查两个 id

javascript - 尝试检测第二次单击复选框时出现停止传播问题

jquery - 带有 href# anchor 的链接不会打开 #div