我正在使用jQuery插件plax:https://github.com/cameronmcefee/plax如何使視差響應?
我做了我自己的例子,並希望它是響應式的。現在,這個位置對於CSS中的移動元素是絕對的,但我需要它是相對的,所以我可以使它響應。
但我不能讓它的工作
見我的小提琴:http://jsfiddle.net/FfKgY/
我認爲這個問題是與CSS:
#shell {
display: block;
position: relative;
margin: 100px auto;
width: 100%;
max-width: 318px;
height: 100%;
max-height: 318px;
z-index: 1;
}
#plax-logo {
width: 136px;
height: 70px;
position: absolute;
top: 170px;
left: 90px;
z-index: 3;
background:#099;
}
#plax-sphere-1 {
width: 93px;
height: 92px;
position: absolute;
z-index: 4;
top: 189px;
left: 191px;
background: #3CC;
}
#plax-sphere-2 {
width: 215px;
height: 215px;
position: absolute;
z-index: 2;
top: 100px;
left: 53px;
background: #3C9;
}
#plax-sphere-3 {
width: 93px;
height: 92px;
position: absolute;
top: 35px;
left: 32px;
z-index: 1;
background: #669;
}
我知道該怎麼做響應化佈局。但是我似乎無法獲得上面提到的視差jQuery插件來使用響應式佈局。 我對jQuery並不擅長,因此我的問題在這裏,所以我真的不知道在從StackOverflow的其他帖子的鏈接中尋找什麼? – DWTBC 2013-05-01 09:03:32
編輯我的答案。 – 2013-05-01 09:20:55
所以你不認爲有可能用css修復它? 我會試試這個,並讓你知道它是怎麼進行的 – DWTBC 2013-05-01 10:45:59