답변 2개 / 댓글 2개
한번 짜봤습니다. 그대로 넣어서 테스트 해보세요~
Copy
<iframe id="change_view" src="http://baemoc.com" width="100%" height="500px" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto"></iframe>
<script>
var timer_second = 10; //10초
var loop_cnt = 0;
var url_arr = new Array;
url_arr.push("http://gogomotors.co.kr");
url_arr.push("http://nate.com");
url_arr.push("http://daum.net");
setInterval(function(){
document.getElementById('change_view').src = url_arr[loop_cnt];
loop_cnt++;
if(url_arr.length <= loop_cnt){
loop_cnt = 0;
}
}, timer_second*1000);
</script>
jquery에서
setInterval(function() {
alert('http://webisfree.com');
}, 3000);
실행시켜면 될듯한데
자동으로 변경이라는게 어떤건지..
답변에 대한 댓글 2개
답변을 작성하려면 로그인이 필요합니다.