Commit ae06e6b7 by doszhang

dos

parent 8145c0b7
...@@ -87,12 +87,14 @@ ...@@ -87,12 +87,14 @@
<body> <body>
<audio src="__CDN__/media/1.mp3" preload="auto" loop="loop" id="music" style="display:none"></audio> <audio src="__CDN__/media/1.mp3" preload="auto" loop="loop" id="music" style="display:none"></audio>
<div class="container"> <div class="wrap">
<div class="wrap-inner">
{:if $projectId && strpos( $smarty.server.HTTP_HOST , 'dev.izhida.cn') !== false} {:if $projectId && strpos( $smarty.server.HTTP_HOST , 'dev.izhida.cn') !== false}
{:"http://projectx.dev.izhida.cn/api/html/id/`$projectId`"|file_get_contents} {:"http://projectx.dev.izhida.cn/api/html/id/`$projectId`"|file_get_contents}
{:else} {:else}
{:block name='body'}{:/block} {:block name='body'}{:/block}
{:/if} {:/if}
</div>
</div> </div>
......
...@@ -62,7 +62,7 @@ body { ...@@ -62,7 +62,7 @@ body {
font-size: 30px; font-size: 30px;
} }
.container { .wrap {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute; position: absolute;
...@@ -70,13 +70,18 @@ body { ...@@ -70,13 +70,18 @@ body {
left: 0; left: 0;
right: 0; right: 0;
margin: 0 auto; margin: 0 auto;
overflow-y: scroll; overflow: hidden;
overflow-x: hidden;
} }
.container.fix { .wrap-inner {
top: -50%; position: absolute;
transform: translateY(50%); overflow: scroll;
left: 0;
width: 640px;
height: 1238px;
top: 50%;
transform: translate(0, -50%);
-webkit-transform: translate(0, -50%);
} }
.page { .page {
......
...@@ -96,22 +96,22 @@ const guardian = [ ...@@ -96,22 +96,22 @@ const guardian = [
] ]
$(document).ready(function () { $(document).ready(function () {
$('.container').addClass('fix') // $('.container').addClass('fix')
if ($('.page2').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 { // } else {
fixHeight = Math.abs($('.page').height() - document.documentElement.clientHeight) / 2; // fixHeight = Math.abs($('.page').height() - document.documentElement.clientHeight) / 2;
} // }
$('.container').css('height', document.documentElement.clientHeight + 'px'); // $('.container').css('height', document.documentElement.clientHeight + 'px');
$("input").on("blur", function () { $("input").on("blur", function () {
window.scroll(0, 0); //失焦后强制让页面归位 window.scroll(0, 0); //失焦后强制让页面归位
}); });
$('.container').on('scroll', showItem) $('.wrap-inner').on('scroll', showItem)
$('.page1 .btn-next').on('click', toPage2); $('.page1 .btn-next').on('click', toPage2);
$('.page2 .btn-next').on('click', toPage3); $('.page2 .btn-next').on('click', toPage3);
......
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