Created
July 3, 2011 13:13
-
-
Save superbrothers/1062218 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function timestamp() { | |
echo time(); | |
} | |
?> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<input type="button" id="button" value="LOAD"> | |
<ul> | |
<li><img data-src="http://tiqav.com/2LC.th.jpg?<?php timestamp(); ?>"></li> | |
<li><img data-src="http://tiqav.com/Fy.th.jpg?<?php timestamp(); ?>"></li> | |
<li><img data-src="http://tiqav.com/1Ci.th.jpg?<?php timestamp(); ?>"></li> | |
<li><img data-src="http://tiqav.com/j5.th.jpg?<?php timestamp(); ?>"></li> | |
</ul> | |
<script> | |
<!-- | |
document.getElementById('button').addEventListener('click', function () { | |
loadImage(document.getElementsByTagName('img')); | |
this.removeEventListener('click', arguments.callee, false); | |
}, false); | |
function loadImage(nodeList) { | |
[].forEach.call(nodeList, function (img) { | |
var src = img.getAttribute('data-src'); | |
if (src !== undefined) { | |
img.setAttribute('src', src); | |
} | |
}); | |
} | |
--> | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment