(X)HTML, JavaScript, DHTML, XML, CSS Client scripting tehnologije, Dynamic HTML, Cascading Stylesheets, XML i standardi |
|
Alati teme | Način prikaza |
15. 10. 2012. | #11 |
član
Certified
Datum učlanjenja: 06.09.2012
Poruke: 64
Hvala: 0
342 "Hvala" u 10 poruka
|
Hvala, ovaj kod mi je potreban, samo mi je neophodno da i prva slika bude ucitana posle 5 sekundi, prva slika se automatski ucitava cim se otvori stranica
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> <style> .photo { display: none; } </style> <script type="text/javascript"> window.onload = function() { var images = document.getElementsByClassName('photo'); var delayInSeconds = 5; var current = 0; images[0].style.display = 'inline-block'; setTimeout(function() { current++; images[current].style.display = 'inline-block'; if(current < images.length - 1) { setTimeout(arguments.callee, delayInSeconds * 1000); } }, delayInSeconds * 1000); } </script> </head> <body> <img src="images/dukes.png" class="photo" /> <img src="images/sl1.png" class="photo" /> <img src="images/logo01.png" class="photo" /> </body> </html> |
|
|