98
rated 0 times
[
99]
[
1]
/ answers: 1 / hits: 22207
/ 10 Years ago, wed, august 6, 2014, 12:00:00
Attempting to load images from my JavaScript array and display the first one the array. I then need to add a function that will allow the next image in the array to be displayed and so on till the end of the array.
<script>
var images = [ '/images/1.png', '/images/2.png' ];
function buildImages() {
for (var i = 0; i < images.length; i++) {
document.createElement(images[i]);
}
}
</script>
</head>
<body>
<div onload=buildImages(); class=contents id=content></div>
</body>
Within the images array are paths to the images. They look like server/images/05-08-2014-1407249924.png
More From » html