我是Cordova的新手,我已经开始使用HTML,CSS和JS将大型pdf书籍转换为Android应用程序。 由于这本书很大,我想让我的应用程序从我离开的地方开始,这样我就不会忘记 到目前为止,我已经阅读了哪一部分。 现在,我的问题是我能做到吗? 如果是,那怎么办?
!!!!!更新 !!!!!
我正在向您展示实际的HTML / JS代码。请看看并告诉我在哪里犯错误。 (我是javascript的新手)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>T-Rex Album|Home</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<script>
function herok(){
var a=localStorage.setItem("LastPosition", "CurrentPosition");
var elmnt=document.getElementById("myDIV");
var CurrentPosition=elmnt.scrollTop;
localStorage.setItem("LastPosition", "CurrentPosition");
var FinalPosition=document.getElementById('cat').innerHTML=localStorage.getItem("LastPosition");
}
function scrollWin() {
window.scrollTo(0, a);
}
</script>
</head>
<body onunload="herok()">
<button onclick="scrollWin()" style="position:fixed;">Start From Where You Left</button>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<p>dummy text</p>
<script src="js/jquery-1.10.2.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>