WordPress Hosting
Free Photos
WordPress Themes


(function() { function id(v){ return document.getElementById(v); } function counter() { var elements = document.getElementsByClassName("slide"); var tmp = new Image(); if(elements.length === 0){ alert("Nothing to do"); return; } alert(elements.length); function loaded(){ alert("Loaded"); } for(var i = 0; i < elements.length; i++){ var element = elements[i]; //alert(element); var url = (element).style.backgroundImage; alert(url); tmp = new Image(); tmp.onload = loaded; tmp.src = url; } alert("Done"); } document.addEventListener('DOMContentLoaded', counter, false); }());

3 Responses

What line is not working as you expect?
@Davis Allen Is it line 18, the alert isn't showing anything?
@Davis Allen Yeah it's just blank

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.