如何实现固定位置背景滚动/显示效果? jQuery插件可用吗?

时间:2012-09-04 08:59:48

标签: javascript jquery html css effect

我想知道是否有人知道是否有jquery插件,或者如何实现这种在时尚品牌krystalrae.com的'collection'部分可见的效果

Screen Capture Video

非常感谢任何正确方向的提示或推动!

谢谢!

3 个答案:

答案 0 :(得分:24)

你可以用CSS做到这一点。您只需要一些与窗口高度相同的div,使用属性background-attachment: fixed;的不同背景图像。

#one
{
    background: url(http://images.buzzillions.com/images_products/07/02/iron-horse-maverick-elite-mountain-bike-performance-exclusive_13526_100.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment:fixed;
}

#two
{
    background: url(http://img01.static-nextag.com/image/GMC-Denali-Road-Bike/1/000/006/107/006/610700673.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment:fixed;
}

http://jsfiddle.net/Kyle_/mbhLN/

答案 1 :(得分:2)

HERE你会找到你的插件!

是视差效应。

答案 2 :(得分:0)

探索这些内容的一个好方法是使用firefox中的firebug插件或chrome中的开发者控制台打开页面,然后查看页面源。

如果您尝试某些内容,它也有帮助,然后发布您遇到问题的内容。

您还可以使用jQuery插件实现效果:

  1. http://gsgd.co.uk/sandbox/jquery/easing
  2. http://www.smoothdivscroll.com