Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e606a9a4e3
Fetching contributors…

Cannot retrieve contributors at this time

57 lines (52 sloc) 1.812 kb
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Zepto assets functional test</title>
<meta name="viewport" content="maximum-scale=1,initial-scale=1,user-scalable=0">
<script src="../src/polyfill.js"></script>
<script src="../src/zepto.js"></script>
<style>
#container div {
margin: 2px;
padding: 2px;
display: block;
background-color: #ccc;
}
img {
margin: 0;
height: 100px;
vertical-align: middle;
}
</style>
</head>
<body>
<h1>Zepto assets functional test</h1>
<ul>
<li><a href="?without">Run without the assets plugin</a></li>
<li><a href="?with">Run with the assets plugin</a></li>
<li><a href="?">Stop</a></li>
</ul>
<p>When you run this test without the assets plugin, Mobile Safari will stop loading after on average 8 images (that's on the iPad with 1 MB images). It might also crash.</p>
<p><strong>PLEASE NOTE:</strong> You <strong>must restart Safari</strong> between runs (click the home button to return to the home screen, double-click the home button, tap-and-hold the Safari icon, then tap the minus badge).</p>
<div id="container"></div>
<script>
var prefix = 'http://stuff.vandervossen.net/temporary/zepto_assets_test/sintel-',
mode = window.location.search.slice(1),
timeout,
i;
if (mode === 'with') {
document.write('<script src="../src/assets.js"></s'+'cript>');
document.write('RUNNING WITH ASSETS PLUGIN');
}
if (mode !== '') {
i = 1;
(function frame() {
$('#image' + (i - 4)).remove();
$('#container').prepend('<div>' + i + ': <img id="image' + i + '" src="' + prefix + i + '.jpg"></div>');
if (i++ < 51) timeout = setTimeout(frame, 6000);
})();
}
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.