stanko2121
Registered
Имам един iframe който трябва да сменя src-то си през 2500 милисекунди.
Някой може ли да помогне ?
Някой може ли да помогне ?
Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script>
$(document).ready(function(){
var locations = ["http://webPage1.com", "http://webPage2.com"];
var len = locations.length;
var iframe = $('#frame');
var i = 0;
setInterval(function () {
$(iframe).attr('src', locations[++i % len]);
}, 2500);
});
</script>
</head>
<body>
<iframe id="frame"></iframe>
</body>
</html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script>
$(document).ready(function(){
var locations = ["http://webPage1.com", "http://webPage2.com"];
var len = locations.length;
var iframe = $('#frame');
var i = 0;
$(iframe).attr('src', locations[i]);
setInterval(function () {
$(iframe).attr('src', locations[++i % len]);
}, 2500);
});
</script>
</head>
<body>
<iframe id="frame"></iframe>
</body>
</html>