Commit 91bfcc07 by doszhang

dos

parent f7c6d2a6
......@@ -55,7 +55,9 @@ var fireworkLock = false;
let posterCanvas, posterCtx;
let scrollTimer, showTitleStatus = false;
let scrollTimer,
showItemStatus = false,
nowShowIndex = 1;
const guardian = [
'事事顺意守',
......@@ -84,7 +86,7 @@ $(document).ready(function () {
window.scroll(0, 0); //失焦后强制让页面归位
});
$('.container').on('scroll', showTitle)
$('.container').on('scroll', showItem)
$('.page1 .btn-next').on('click', toPage2);
$('.page2 .btn-next').on('click', toPage3);
......@@ -105,8 +107,8 @@ $(document).ready(function () {
$('.btn-retry').on('click', retry)
});
function showTitle() {
if (showTitleStatus) {
function showItem() {
if (showItemStatus) {
return false;
}
if (scrollTimer !== null) {
......@@ -114,9 +116,16 @@ function showTitle() {
}
scrollTimer = setTimeout(() => {
const scrollTop = $('.container').scrollTop();
if (scrollTop > 700) {
const scrollLeft = $('.container').scrollLeft();
if (nowShowIndex == 1 && scrollTop > 700) {
$('.title').show();
showTitleStatus = true;
nowShowIndex++
} else if (nowShowIndex == 2 && scrollLeft > 380) {
$('.toast1').show();
nowShowIndex++
} else if (nowShowIndex == 3 && scrollLeft > 930) {
$('.toast2').show();
nowShowIndex++
}
}, 100)
}
......@@ -151,7 +160,7 @@ function retry() {
$('.page1').show();
fireworkLock = false
updateWorld()
showTitleStatus = false
showItemStatus = false
$('.title').hide()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment