jSrcoller 总是将我的 div 固定在顶部

发布于 2024-09-11 06:40:34 字数 889 浏览 1 评论 0原文

我正在使用 jScroller 来显示字幕。它工作正常,但它总是将我的 div 粘在顶部页面的位置而不是 div 的确切位置....

<div id="CaptDiv"> // this div is at the centre of my page
    <div id="CaptionDiv" class="captiontext">
        Find your Leads to Precede and Predate
    </div>
</div>

我只应用了这个 css...

.captiontext
{
 font-weight:bold; color:#69442f;
 font-family: Arial,Helvetica,sans-serif; font-size:105%;margin-left:70px;
}

和我的 jquery,

     $(document).ready(function() {
        $jScroller.add("#CaptDiv", "#CaptionDiv", "right", 1);
        $jScroller.start();
    });

替代文本 http://img409.imageshack.us/img409/985/marquee.jpg

I am using jScroller to show a marquee.. It works fine but it always sticks my div to top of the page rather than the exact position of the div....

<div id="CaptDiv"> // this div is at the centre of my page
    <div id="CaptionDiv" class="captiontext">
        Find your Leads to Precede and Predate
    </div>
</div>

and i have applied this css only...

.captiontext
{
 font-weight:bold; color:#69442f;
 font-family: Arial,Helvetica,sans-serif; font-size:105%;margin-left:70px;
}

and my jquery,

     $(document).ready(function() {
        $jScroller.add("#CaptDiv", "#CaptionDiv", "right", 1);
        $jScroller.start();
    });

alt text http://img409.imageshack.us/img409/985/marquee.jpg

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

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

发布评论

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

评论(1

本王不退位尔等都是臣 2024-09-18 06:40:34

尝试添加position:相对于包含滚动条的div。我想象 JsScroller 正在向滚动器 div 添加position:absolute,并且滚动器 div 没有定位父级。因此,滚动条 div 是相对于 body 元素绝对定位的

Try adding position: relative to div that contains the scroller. I would imagine JsScroller is adding position: absolute to the scroller div and the scroller div has no positioned parent. The scroller div is therfore positioned absolutely in relation to the body element

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文