我試圖做一個簡單的固定,而滾動與ScrollToFixed,但我已經遇到了一些怪異的行爲scrollToFixed - 奇怪的滾動發行
我已經準備了jsfiddle顯示了下列問題:
HTML :
<div class="row-fluid">
<div id="car_left_col" class="span2">left</div>
<div id="car_center" class="span8">
<div class="car_main thumbnail">
<div class="car_cover">
<img alt="" src="http://www.autopulze.com/wp-content/uploads/2012/07/Rolls-Royce-Silver-Ghost-the-Best-Car-in-the-World.jpg">
</div>
<hr>
<div class="car_page_creator"></div>
</div>
<div class="car_talk">here are the comments for the car</div>
</div>
<div id="car_right_col" class="span2">
<div class="car_vote test_fixed">I should not move</div>
</div>
<div class="long"></div>
CSS:
.long {
height: 10000px;
}
#car_right_col {
position: relative;
}
.car_main {
position: relative;
padding: 0;
}
.car_cover {
width: 100%;
position: relative;
}
.car_cover img {
width: 100%;
}
.test_fixed {
position: static;
}
.car_vote {
position: relative;
}
個JS:
$(document).ready(function() {
$('.test_fixed').scrollToFixed({
marginTop: 45,
limit: $('.car_page_creator').offset().top
});
});
- 滾動一路下來的時候,看到一個水平滾動條,可笑的拉伸頁面右邊
- 我認爲這是與第一個問題做的,該項目是固定,
.test-fixed
,有一個非常大的left
屬性時,向下滾動 - (從一路下跌)通過點擊向上滾動時保持滾動條,一旦它到達固定的項目來看,它只是不正常
我認爲我的html和css幾乎沒有什麼特別的標準..這是由於我的代碼或插件中的錯誤?
我無法重現該行爲。 – howderek
嘗試用這個全屏http://jsfiddle.net/guyisra/kspA8/2/embedded/result/ - 請注意,有2個滾動條,所以水平是可見的最底部 –
我看,這是很奇怪的。 – howderek