Commit 02eb8780 by doszhang

dos

parent 1d5ed14d
...@@ -74,6 +74,11 @@ body { ...@@ -74,6 +74,11 @@ body {
overflow-x: hidden; overflow-x: hidden;
} }
.container.fix {
top: -50%;
transform: translateY(50%);
}
.page { .page {
/* top: 50%; /* top: 50%;
transform: translate(0, -50%); */ transform: translate(0, -50%); */
......
...@@ -80,6 +80,8 @@ let scrollTimer, ...@@ -80,6 +80,8 @@ let scrollTimer,
nowShowIndex = 1, nowShowIndex = 1,
createPosterLock = false; createPosterLock = false;
let fixHeight = 0;
const guardian = [ const guardian = [
'事事顺意守', '事事顺意守',
'健康祈愿守', '健康祈愿守',
...@@ -94,15 +96,16 @@ const guardian = [ ...@@ -94,15 +96,16 @@ const guardian = [
] ]
$(document).ready(function () { $(document).ready(function () {
if ($('.page').height() < document.documentElement.clientHeight) { if ($('.page2').height() < document.documentElement.clientHeight) {
var scale = document.documentElement.clientHeight / $('.page').height(); var scale = document.documentElement.clientHeight / $('.page').height();
$('.bg').css({ $('.bg').css({
'transform': 'scale(1,' + scale + ')' 'transform': 'scale(1,' + scale + ')'
}); });
} else {
fixHeight = Math.abs($('.page').height() - document.documentElement.clientHeight) / 2;
} }
$('.container').css('height', document.documentElement.clientHeight + 'px'); $('.container').css('height', document.documentElement.clientHeight + 'px');
var fixHeight = Math.abs($('.page').height() - document.documentElement.clientHeight) / 2;
$('.logo').css('top', fixHeight + 30 + 'px');
$("input").on("blur", function () { $("input").on("blur", function () {
window.scroll(0, 0); //失焦后强制让页面归位 window.scroll(0, 0); //失焦后强制让页面归位
}); });
...@@ -159,7 +162,7 @@ function toscene(event) { ...@@ -159,7 +162,7 @@ function toscene(event) {
} }
function toPage2() { function toPage2() {
$('.container').css('overflow-x', 'scroll').css('overflow-y', 'hidden'); $('.container').css('overflow-x', 'scroll').css('overflow-y', 'hidden').addClass('fix');
$('.page1').hide(); $('.page1').hide();
$('.page2').show(); $('.page2').show();
fireworkLock = true; fireworkLock = true;
......
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