Commit 719ee03b by doszhang

dos

parent 31f7f838
...@@ -102,7 +102,12 @@ $('.page1').show(); ...@@ -102,7 +102,12 @@ $('.page1').show();
preloadimages(preloadImageList, function () {}, function (progress) {}); preloadimages(preloadImageList, function () {}, function (progress) {});
var EventUtil = {
$(document).ready(function () {
var EventUtil = {
addHandler: function (element, type, handler) { addHandler: function (element, type, handler) {
if (element.addEventListener) { if (element.addEventListener) {
element.addEventListener(type, handler, false); element.addEventListener(type, handler, false);
...@@ -112,25 +117,22 @@ var EventUtil = { ...@@ -112,25 +117,22 @@ var EventUtil = {
element["on" + type] = handler; element["on" + type] = handler;
} }
} }
}; };
(function () { (function () {
var showCount = 0; var showCount = 0;
EventUtil.addHandler(window, "load", function () {}); EventUtil.addHandler(window, "load", function () {});
EventUtil.addHandler(window, "pageshow", function (event) { EventUtil.addHandler(window, "pageshow", function (event) {
showCount++; showCount++;
alert("Show has been fired " + showCount + " times."); alert("Show has been fired " + showCount + " times.");
}); });
})(); })();
window.addEventListener('pageshow', function (e) { window.addEventListener('pageshow', function (e) {
if (e.persisted || (window.performance && window.performance.navigation.type == 2)) { if (e.persisted || (window.performance && window.performance.navigation.type == 2)) {
alert('show') alert('show')
} }
}); });
$(document).ready(function () {
for (let i = 0; i < 21; i++) { for (let i = 0; i < 21; i++) {
$('.read' + i).hide(); $('.read' + i).hide();
} }
......
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