即時嘗試在5秒後淡入視頻,然後按下按鈕後淡出視頻,然後將頁面滾動到下一部分。我的動畫無法按預期工作
在下一節中,它應該爲一些div製作動畫,然後....按下按鈕轉到下一節,淡入淡出之前動畫的div,然後進入下一節。
第三個滾動按鈕根本不起作用。
只有最後2個滾動按鈕的工作....我不明白爲什麼只有這些最後2,而不是前3周。
注:Id也喜歡殺死頁面上的滾動條,並通過滾動按鈕導航頁面。這裏是我的代碼是給我找麻煩:
<script>
$(document).ready(function(){
//Kill Page Scrollbar
$('html, body').css({
'overflow': 'hidden',
'height': '100%'
});
//animate the registration video fading in
$('#Video').fadeTo(3000, 1);
//Make scrollbutton clickable
$('.ScrollButton_White1').click(function(){
//Fade Video out
$('#Video').fadeTo(3000, 0), (function(){
//define the variable "diamonds"
var diamonds = $('#PresenterContainer').children()
//animate the scrolling of the page down to the anchor point//
$('html, body').animate({
scrollTop: $("#PresenterContainer_AnchorPoint").offset().top
}, 5000,
function() {
diamonds.show();
});
});
});
<!--scroll button 2-->
$('.ScrollButton_Gold1').click(function(){
diamonds.hide();
$('html, body').animate({
scrollTop: $("#YouAskedForIt_AnchorPoint").offset().top
}, 5000
);
});
<!--scroll button 3-->
$('.ScrollButton_White3').click(function(){
$('html, body').animate({
scrollTop: $("#ReturnChampion_AnchorPoint").offset().top
}, 5000
);
});
<!--scroll button 4-->
$('.ScrollButton_Gold1').click(function(){
$('html, body').animate({
scrollTop: $("#YouAskedForIt_AnchorPoint").offset().top
}, 5000);
});
<!--scroll button 5-->
$('.ScrollButton_Gold2').click(function(){
$('html, body').animate({
scrollTop: $("#WhatYouWillLearn_AnchorPoint").offset().top
}, 5000);
});
<!--animate presenter diamond buttons-->
<!--$(window).scroll(function(event) {
<!--$('#Diamond_DarrenHardy').addClass('animate_rf');
<!--$('#Diamond_RobertKiyosaki').addClass('animate_rf');-->
<!--});
<!--end jquery script-->
});
</script>
看來你正在創造一些東西,嘗試使用現場活動。 – stanze 2015-03-31 05:20:28
我該怎麼做? – WillingLearner 2015-03-31 05:52:59
-2-和-4都使用相同的選擇器'.ScrollButton_Gold1'。 '鑽石'是-1的本地化,但是-2-嘗試使用它。你應該在你的控制檯中看到一個錯誤。在寫作/檢查你的代碼時更加謹慎。 – 2015-03-31 05:58:50