-
Notifications
You must be signed in to change notification settings - Fork 0
/
mobile.html
51 lines (44 loc) · 1.7 KB
/
mobile.html
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
<!DOCTYPE html>
<html>
<head>
<title>Spinka 5784</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script type="text/javascript">
var script = document.createElement('script');
script.src = 'iframeData'.js'; // Assuming your file is named like iframeData_YYYY-MM-DD.js
script.onload = function () {
// The external script has loaded, proceed with your code
// Define an array of objects with src and milliseconds properties from the loaded external file
var iframeArray = window.iframeArray || [];
// Create iframes and append them to the body
var iframes = [];
for (var i = 0; i < iframeArray.length; i++) {
var iframe = document.createElement('iframe');
iframe.src = iframeArray[i].src;
iframe.style = "position: fixed; left: 0px; top: -51px; width: 100%; height: 108%;";
iframe.style.display = (i === 0) ? 'block' : 'none'; // Show the first iframe, hide others
document.body.appendChild(iframe);
iframes.push(iframe);
}
// Function to rotate through iframes
function rotateIframes(index) {
// Hide all iframes
for (var i = 0; i < iframes.length; i++) {
iframes[i].style.display = 'none';
}
// Show the active iframe
iframes[index].style.display = 'block';
// Rotate to the next iframe after the specified milliseconds
setTimeout(function () {
rotateIframes((index + 1) % iframeArray.length);
}, iframeArray[index].milliseconds);
}
// Initialize the rotation on page load
rotateIframes(0);
};
document.head.appendChild(script);
</script>
</body>
</html>