fix: 样式调整
This commit is contained in:
+127
-118
@@ -1,126 +1,135 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<title>详情</title>
|
||||
<link rel="stylesheet" href="./pdf/style.css" />
|
||||
<link rel="stylesheet" href="./pdf/pdfh5.css" />
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.operate {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
width: 100px;
|
||||
padding: 5px;
|
||||
display: flex;
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
border-radius: 5px;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
#up,
|
||||
#down {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#number {
|
||||
width: 50px;
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
#percent {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
#down {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="operate">
|
||||
<div id="up">+</div>
|
||||
<div id="number">100</div>
|
||||
<div id="percent">%</div>
|
||||
<div id="down">-</div>
|
||||
</div>
|
||||
<div id="pdf-view"></div>
|
||||
<script src="./pdf/pdf.js"></script>
|
||||
<script src="./pdf/pdf.worker.js"></script>
|
||||
<script src="./pdf/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./pdf/pdfh5.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var pdfh5;
|
||||
$(function () {
|
||||
$("#pdf-view").show()
|
||||
var url = getQuery('url');
|
||||
pdfh5 = new Pdfh5('#pdf-view', {
|
||||
pdfurl: url,
|
||||
lazy: true,
|
||||
renderType: 'png', // svg
|
||||
URIenable: true //开启浏览器地址栏file参数获取
|
||||
});
|
||||
|
||||
//pdf准备开始渲染,此时可以拿到pdf总页数
|
||||
pdfh5.on("ready", function () {
|
||||
console.log("pdf准备开始渲染,总页数:" + this.totalNum)
|
||||
})
|
||||
//监听pdf渲染成功
|
||||
pdfh5.on("success", function (time) {
|
||||
time = time / 1000
|
||||
console.log("pdf渲染完成,总耗时" + time + "秒");
|
||||
})
|
||||
})
|
||||
function getQuery(name) {
|
||||
// 正则:[找寻'&' + 'url参数名字' = '值' + '&']('&'可以不存在)
|
||||
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
||||
let r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) {
|
||||
// 对参数值进行解码
|
||||
return decodeURIComponent(r[2]);
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<title>详情</title>
|
||||
<link rel="stylesheet" href="./pdf/style.css" />
|
||||
<link rel="stylesheet" href="./pdf/pdfh5.css" />
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
let count = 100;
|
||||
$('#up').click(function () {
|
||||
var div = $('.pdfjs .pdfViewer .pageContainer img')
|
||||
var width = div.width();
|
||||
var add = width / 10;
|
||||
count += 10;
|
||||
|
||||
div.width(width + add)
|
||||
$('#number').text(count);
|
||||
})
|
||||
$('#down').click(function () {
|
||||
var div = $('.pdfjs .pdfViewer .pageContainer img')
|
||||
var width = div.width();
|
||||
var add = width / 10;
|
||||
count -= 10;
|
||||
body {
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
||||
div.width(width - add)
|
||||
$('#number').text(count);
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
.operate {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
width: 100px;
|
||||
padding: 5px;
|
||||
display: flex;
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
border-radius: 5px;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
#up,
|
||||
#down {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#number {
|
||||
width: 50px;
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
#percent {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
#down {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
/* #pdf-view {
|
||||
padding-bottom: 40px;
|
||||
} */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="operate">
|
||||
<div id="up">+</div>
|
||||
<div id="number">100</div>
|
||||
<div id="percent">%</div>
|
||||
<div id="down">-</div>
|
||||
</div>
|
||||
<div id="pdf-view"></div>
|
||||
<script src="./pdf/pdf.js"></script>
|
||||
<script src="./pdf/pdf.worker.js"></script>
|
||||
<script src="./pdf/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./pdf/pdfh5.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var pdfh5;
|
||||
$(function() {
|
||||
$("#pdf-view").show()
|
||||
var url = getQuery('url');
|
||||
pdfh5 = new Pdfh5('#pdf-view', {
|
||||
pdfurl: url,
|
||||
lazy: true,
|
||||
renderType: 'png', // svg
|
||||
URIenable: true //开启浏览器地址栏file参数获取
|
||||
});
|
||||
|
||||
//pdf准备开始渲染,此时可以拿到pdf总页数
|
||||
pdfh5.on("ready", function() {
|
||||
console.log("pdf准备开始渲染,总页数:" + this.totalNum)
|
||||
})
|
||||
//监听pdf渲染成功
|
||||
pdfh5.on("success", function(time) {
|
||||
time = time / 1000
|
||||
console.log("pdf渲染完成,总耗时" + time + "秒");
|
||||
})
|
||||
})
|
||||
|
||||
function getQuery(name) {
|
||||
// 正则:[找寻'&' + 'url参数名字' = '值' + '&']('&'可以不存在)
|
||||
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
||||
let r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) {
|
||||
// 对参数值进行解码
|
||||
return decodeURIComponent(r[2]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
let count = 100;
|
||||
$('#up').click(function() {
|
||||
var div = $('.pdfjs .pdfViewer .pageContainer img')
|
||||
var width = div.width();
|
||||
var add = width / 10;
|
||||
count += 10;
|
||||
|
||||
div.width(width + add)
|
||||
$('#number').text(count);
|
||||
})
|
||||
$('#down').click(function() {
|
||||
var div = $('.pdfjs .pdfViewer .pageContainer img')
|
||||
var width = div.width();
|
||||
var add = width / 10;
|
||||
count -= 10;
|
||||
|
||||
div.width(width - add)
|
||||
$('#number').text(count);
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user