无法让 rCarousel 工作(导航宽度和自动滚动)

发布于 2024-12-08 10:47:54 字数 471 浏览 0 评论 0原文

http://www.netwerkhoreca.nl/

我做错了什么,但我找不到什么...... 。 不知怎的,我无法让 rCarousel 工作(顶部写着“vrienden van het koksgilde”)。

我真的不知道我做错了什么。 我按照本页上的说明进行操作: http://ryrych.github.com/rcarousel/

我仔细检查了如果我的脚本和 CSS 链接正确的话,它们就是正确的。由于某种原因,它的导航不起作用,也不会自动滚动。我也无法设置旋转木马的宽度以适应盒子。

当我查看 firebug 时,我发现元素具有内联样式,我认为这应该与它有关?

一些帮助将不胜感激。

http://www.netwerkhoreca.nl/

I am doing something wrong, but i cannot find what....
Somehow i cannot get the rCarousel to work (top part which says "vrienden van het koksgilde").

I dont really know what i am doing wrong.
I followedthe instructions on this page: http://ryrych.github.com/rcarousel/

I double checked if my links to the scripts and css are right and they are. For some reason the nav of it wont work, neither will it autoscroll. Also i cannot set the width of the carousel to fit the box.

When i am looking with firebug i see that the elements get inline styles, that should have something to do with it i think?

Some help would be greatly apreciated.

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

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

发布评论

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

评论(1

失眠症患者 2024-12-15 10:47:55

目前,轮播中只有 3 个项目,并且它们都是可见的 - 因此,当您单击上一个/下一个时,无需执行任何操作;)

CSS 中的第 33 行是它不适合框的问题:

#topbox1 div, #topbox2 div, #topbox3 div {
    color: #888888;
    line-height: 17px;
    padding: 5px 10px 5px 14px;
    width: 100%;
}

它设置了所有 div 的宽度每个 ID 容器为 100%,即 300px,加上指定的填充 = 324px,这就是它爆发的原因。 H1 也是如此,只是它们没有明显破损,但它们正在从容器中渗出。

它通过 div 进行级联,您想要保持填充的宽度是 276px;

#topbox2 #carousel {width:276px;}

将覆盖样式并使其适合,但是我建议您查看宽度发生的情况并使它们更具体一些。

例如

#topbox1 > div, #topbox2 > div, #topbox3 > div {
    color: #888888;
    line-height: 17px;
    padding: 5px 10px 5px 14px;
    width: 276px;
}

,所以只是 #topboxes 中的直接子 div 并删除标题的宽度:

#topbox1 h1, #topbox2 h1, #topbox3 h1 {
   color: #FFFFFF;
   font-size: 24px;
   padding: 7px 10px 10px 14px;
}

希望这是有道理的!

Currently you only have 3 items in the carousel and they are all visible - therefore there is nothing to do when you click previous/next ;)

Line 33 in your css is the issue with it not fitting the box:

#topbox1 div, #topbox2 div, #topbox3 div {
    color: #888888;
    line-height: 17px;
    padding: 5px 10px 5px 14px;
    width: 100%;
}

Its setting all div's width within each ID'd container to 100%, which is 300px, add to that the padding specified = 324px, which is why its breaking out. Same goes for your H1's just that they are not visibly broken however they are bleeding out of there containers.

Its cascading through the divs, the width you want with that padding maintained is 276px;

#topbox2 #carousel {width:276px;}

Will override the style and make it fit, however I would suggest you look at what's happening with the widths and make them a little more specific.

e.g

#topbox1 > div, #topbox2 > div, #topbox3 > div {
    color: #888888;
    line-height: 17px;
    padding: 5px 10px 5px 14px;
    width: 276px;
}

So just the immediate child divs within the #topboxes and remove the width form the headings:

#topbox1 h1, #topbox2 h1, #topbox3 h1 {
   color: #FFFFFF;
   font-size: 24px;
   padding: 7px 10px 10px 14px;
}

Hope that makes sense!

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