這裏是的jsfiddle:http://jsfiddle.net/dAQrE/網站不向下滾動或顯示#proceed事業部在正確的時間
在JavaScript的部分,你會看到,是假設代碼向下滾動到以後的#proceed
div的頂部當它說動畫:
線1,第2行,第3行,第4行..
進行下去的div的頁面是假設滾動到:
<div id="proceed">
<div id="if_one"> <a href="http://websitelinkhere.com/1" class="button_primary agree">If Question 1 = Answer 1</a>
</div>
<div id="if_two"> <a href="http://websitelinkhere.com/2" class="button_primary agree">If Question 1 = Answer 2</a>
</div>
<div id="if_three"> <a href="http://websitelinkhere.com/3" class="button_primary agree">If Question 1 = Answer 3</a>
</div>
</div>
即假設動畫後滾動到#proceed
DIV的JavaScript:
// assign the correct target
var target = $('#proceed');
$('html, body').animate({
scrollTop: target.offset().top
}, 200);
// scroll!
$('html, body').animate({
scrollTop: target.offset().top
}, 200, function() {
target.css({
'border-color': 'red'
})
});
但現在它的顯示中的內容#動畫完成前,它不會向下滾動的div ..如何解決這個問題?
所有這些功能在頁面加載運行,對不對? #proceed在該點甚至不可見。您需要命名這些功能並在正確的時間給它們打電話。 – isherwood
@isherwood腳本之前工作正常,唯一的問題是滾動到#proceed股利,並得到它正確顯示,但沒有試圖讓它滾動,如果我刪除#proceed的div和保持它的內容,那麼它的作品。 。但我需要讓它滾動這是什麼導致我最麻煩..什麼函數需要命名和調用? –