1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
<!DOCTYPE html>
<html>
<head>
<title>...</title>
<style>
html,
body,
iframe {
margin: 0;
width: 100%;
height: 100%;
}
iframe {
display: block;
border: 0;
-moz-transition: all .4s;
-webkit-transition: all .4s;
-ms-transition: all .4s;
-o-transition: all .4s;
transition: all .4s;
}
iframe.fade {
opacity: 0;
}
</style>
<script>
var iframe;
var i = 0;
var delay = 5; // Delay in seconds
var url = [
"http://nagios.xxx.fr/nagvis/index.php?map=plan-reseau1",
"http://nagios.xxx.fr/nagvis/index.php?map=plan-reseau2",
"http://nagios.xxx.fr/nagvis/index.php?map=plan-reseau3",
"http://nagios.xxx.fr/nagvis/index.php?map=plan-reseau4",
"http://nagios.xxx.fr/nagvis/index.php?map=plan-reseau5",
"http://nagios.xxx.fr/nagvis/index.php?map=plan-reseau6",
"http://nagios.xxx.fr/nagvis/index.php?map=plan-reseau7"
];
function recursive_change_url() {
i++;
i %= url.length;
iframe.className = "fade";
iframe.onload = function() {
iframe.className = "";
window.setTimeout(recursive_change_url, delay * 1000);
}
iframe.src = url[i];
}
window.onload = function() {
iframe = document.getElementById("iframe");
iframe.src = url[0];
window.setTimeout(recursive_change_url, delay * 1000);
}
</script>
</head>
<body>
<iframe id="iframe"></iframe>
</body>
</html> |
Partager