Commit ae06e6b7 by doszhang

dos

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