Commit dca937d6 by doszhang

dos

parent 053a6de7
...@@ -51,6 +51,8 @@ var canvas, ctx, w, h, particles = [], ...@@ -51,6 +51,8 @@ var canvas, ctx, w, h, particles = [],
probability = 0.04, probability = 0.04,
xPoint, yPoint; xPoint, yPoint;
var fireworkLock = false;
$(document).ready(function () { $(document).ready(function () {
if ($('.page').height() < document.documentElement.clientHeight) { if ($('.page').height() < document.documentElement.clientHeight) {
var scale = document.documentElement.clientHeight / $('.page').height(); var scale = document.documentElement.clientHeight / $('.page').height();
...@@ -72,8 +74,10 @@ $(document).ready(function () { ...@@ -72,8 +74,10 @@ $(document).ready(function () {
}); });
function toPage2() { function toPage2() {
$('.container').css('overflow-x', 'scroll').css('overflow-y', 'hidden');
$('.page1').hide(); $('.page1').hide();
$('.page2').show(); $('.page2').show();
fireworkLock = false;
} }
function toPage3() { function toPage3() {
...@@ -125,7 +129,9 @@ function updateWorld() { ...@@ -125,7 +129,9 @@ function updateWorld() {
canvas.width = 640; canvas.width = 640;
update(); update();
paint(); paint();
window.requestAnimationFrame(updateWorld); if (!fireworkLock) {
window.requestAnimationFrame(updateWorld);
}
} }
function update() { function update() {
......
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