使用 AnythingSlider 幻灯片背景
单击“下一个”箭头和“上一个”箭头时,我需要滑动背景 - 现在背景位于 #container 元素中 - 但是,这不起作用 - 我尝试将背景放在 ul#slider 上元素 - 但这也不起作用...
我需要的是背景将是滑块与滑块内的 li
一样多...
关于如何做到这一点有什么建议吗?
您可以在此处查看该项目:http://www.i-creative.dk/Slider/
谢谢
I need to slide a background when clicking the "next" arrow, and the "previous" arrow - right now the background is in the #container element - However, that doesnt work - I've tried putting the background on the ul#slider element - But that doesnt work either...
What i need is that the background will be slider as much as the li
inside the slider...
Any suggestions on how to do that ?
You can see the project here: http://www.i-creative.dk/Slider/
thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经构建了类似您所要求的东西,这非常痛苦。
问题是,您所说的是每张幻灯片都有不同的背景图像、页面大小。
2 个选项是:
1:有一个大背景图像,所有背景水平对齐,并在更改 div 时对 css 背景位置进行动画处理,以保持匹配。这样做的好处是只需要下载一张图片,但是会很大。
问题是:如果一次跳多个步骤,您会看到所有其他图像;
它要求您使用固定宽度;
如果你只想改变一张幻灯片的背景,那就很痛苦了;
container
的同级,但具有更高的 z-index。使用 jquery 将其从适当的一侧滑过现有背景。这种方法的好处是,您可以使用 css 使背景图像始终占据屏幕的整个宽度,或者使用更大的成像器并将其居中。请参阅此处:http://cksk.com 示例。
长话短说,您无法使用现成的解决方案来解决这个问题,您需要亲自动手。
此外,您还需要花费大量时间进行优化。
I've built something like what you're asking for, and it's a total pain.
The problem is, you're talking about having a different background image, the size of the page, for EVERY slide.
2 options are:
1: Have one BIG background image, with all the background aligned horizontally, and animate the css background-position when you change a div, to keep things matching. This ahs the advanatage that only one image needs to be downloaded, but it will be big.
Problems are: you see all the other images if you jump multiple steps at once;
it requires that you use a fixed width;
it's a pain if you want to change the background for just one slide;
container
but has a higher z-index. Use jquery to slide this over the existing background, from the appropriate side.The good thing about this method is that you can use css to make the background image always take up the full-width of the screen, or use a bigger imager and have it centred. See here: http://cksk.com for an example.
Long story short, you won't get this working with an off-the-shelf solution, you'll need to get your hands dirty.
Also, you'll need to spend a hell of a lot of time on optimisation.
试试这个CSS...
唯一的问题是UL的宽度是有限的,所以当你到达最后一个面板时,背景结束,但一旦你点击右箭头,背景就会重新出现。
Try this css...
The only problem is that the width of the UL is limited, so when you get to the last panel, the background ends, but reappears once you hit the right arrow.