jscrollpane inside colorbox - iframe 底部被切断?

发布于 2024-12-23 14:42:29 字数 276 浏览 2 评论 0原文

我正在使用 colorbox 打开一个 iframe,在其中调用 jscrollpane 以允许滚动。它可以工作,但在某些情况下(不是全部,看不到图案)下部可能 100px 左右被切断。此外,我无法让滚动条出现在 ipad 上。

有什么想法吗? http://www.ainonline.com/newsmakers/2011

单击时间线中的链接即可查看我的意思是。

I'm using colorbox to open an iframe, inside which i'm calling jscrollpane to allow scrolling. It works, but in some cases (not all, can't see a pattern) the lower maybe 100px or so are cut off. Further, I can't get scrollbars to appear on the ipad.

Any ideas?
http://www.ainonline.com/newsmakers/2011

Click on links in the timeline to see what I mean.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

听风吹 2024-12-30 14:42:29

好吧,我看到的模式是最后一个文本块有时周围有段落标记,有时没有,这恰好与文本是否完全显示一致(

...

)或某些文本保持隐藏(没有

...

< /代码>)。

不会显示最后一段文本:

<div class="articleview scrollpane" style="width:650px">
    <h1>Former Platinum Jet Pilot Gets Six Months Prison Time</h1>
    <div class="pubdate" style="color:#666; margin:10px 0; font-style:italic">August 23, 2011 - 3:20 PM</div>
    Blah blah blah [...] blah.
</div>

将显示最后一段文本:

<div class="articleview scrollpane" style="width:650px">
    <h1>Former Platinum Jet Pilot Gets Six Months Prison Time</h1>
    <div class="pubdate" style="color:#666; margin:10px 0; font-style:italic">August 23, 2011 - 3:20 PM</div>
    <p>Blah blah blah [...] blah.</p>
</div>

如果这可以解决该问题,请告诉我。

对于问题的另一部分(实际上应该在单独的问题中提出),iPad 不在网站上使用滚动条。它使用手势。不过,不用担心——该网站运行良好。

Well, the pattern I am seeing is that the last block of text sometimes has a paragraph markup around it, and sometimes not, which happens to coincide with whether or not the text is shown entirely (with <p>...</p>) or some of the text stays hidden (without <p>...</p>).

Will not show the last bit of text:

<div class="articleview scrollpane" style="width:650px">
    <h1>Former Platinum Jet Pilot Gets Six Months Prison Time</h1>
    <div class="pubdate" style="color:#666; margin:10px 0; font-style:italic">August 23, 2011 - 3:20 PM</div>
    Blah blah blah [...] blah.
</div>

Will show the last bit of text:

<div class="articleview scrollpane" style="width:650px">
    <h1>Former Platinum Jet Pilot Gets Six Months Prison Time</h1>
    <div class="pubdate" style="color:#666; margin:10px 0; font-style:italic">August 23, 2011 - 3:20 PM</div>
    <p>Blah blah blah [...] blah.</p>
</div>

Let me know if this solves that problem.

For the other part of the question (which really should be asked in a separate question), the iPad does not use scrollbars on websites. It uses gestures. Don't worry about it, though -- the site works great.

不即不离 2024-12-30 14:42:29

在通过 iframe 包含的每个页面上,您必须确保明确声明正文的边距,如下所示:

body {
  margin: 0px;
}

如果您不这样做,浏览器将使用它的默认设置,这意味着不同的浏览器也会产生不同的结果。

您应该查看: normalize.css

这是一个设计的样式表将所有浏览器重置为相同的标准样式规则。

On every page included via iframe you must ensure you explicitly state the margin of the body like so:

body {
  margin: 0px;
}

If you don't do this the browser will use it's default settings and this means different results from different browsers also.

You should check out: normalize.css

It is a stylesheet designed to reset all browsers to the same standard styling rules.

雨落□心尘 2024-12-30 14:42:29

这里,您正在加载的页面在正文(用户代理样式表)上有 8 像素的边距,这导致页面有点偏离右侧和底部。那么看起来您丢失了部分页面。

放置边距:0px;在 body 元素上,例如:

body {
    margin: 0px;
}

Here the pages you are loading have a 8px margin on the body (user agent stylesheet), which results the pages are a bit off to the right and bottom. Then it looks like you are missing parts of the pages.

Put margin: 0px; on the body element like:

body {
    margin: 0px;
}
无人接听 2024-12-30 14:42:29

我有类似的问题......这是我的解决方案

$(".gallery").colorbox({
            iframe:true,
            fastIframe:false,
            width:"630px",
            height:"555px",
            scrolling: false,
            rel:'gallery', 
            slideshow:false, 
            onComplete:function(){ $(".cboxIframe").contents().find("body").css("margin","0px");
                //$("#banner").insertBefore("#cboxLoadedContent")
            }
        });

I had a similar problem ... This was my solution

$(".gallery").colorbox({
            iframe:true,
            fastIframe:false,
            width:"630px",
            height:"555px",
            scrolling: false,
            rel:'gallery', 
            slideshow:false, 
            onComplete:function(){ $(".cboxIframe").contents().find("body").css("margin","0px");
                //$("#banner").insertBefore("#cboxLoadedContent")
            }
        });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文