KM盒子APP制作软件

如何制作需要密码登陆的相册

时间:2016-11-29 08:35 点击:

先上效果图:

操作步骤:

1、选择一个分类目录,右键导出WebAPP

2、打开导出的目录,找到index.html文件,然后用记事本打开,在</head>标签前面添加一段js代码如下:

<script>function checkpass(){if(document.getElementById("password").value!=123456){alert("你输入的密码错误!");return false;}alert('登陆成功!');window.location.href='index.html#Gallery000'; }</script>

3、在<body>标签后面添加代码如下:

<div data-role="page" id="pass">
<div data-role="header"><h1>密码相册例子</h1></div>
<div data-role="content" style="margin:15%">
<p style="margin-left:3px">请输入登陆密码:</p>
<p><input name="password" type="text" id="password" value="" size="25"/></p> 
<p><input type="submit" name="button" id="button" value="登  陆" onclick="checkpass()"/></p>
</div>
<div data-role="footer" style="position:absolute; bottom:0;"><h4><a class="ui-link" href="http://www.kmbox.cn">KM盒子</a></h4></div>
</div>

4、保存index.html文件,最后使用自定义首页功能打包成APK。

5、演示例子源文件下载


我要纠错