랜덤이미지배너

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
랜덤이미지배너

QA

랜덤이미지배너

본문

이렇게 하면 되는건가요?

<div>
<script>
 var banners = new Array() ;
      
 banners[0] = '<div><a href="" target="_blank" /><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQKTJek6_ge5gp3UXM9OhsHf9h_AauxXhIhFg&usqp=CAU" border="0" /></a></div>' ;
 banners[1] = '<div><a href="" target="_blank" /><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTYZAAiEM-pyCUHD7jUdfzv75D0pdvwCpJ7UQ&usqp=CAU" border="0" /></a></div>' ;
 banners[2] = '<div><a href="" target="_blank" /><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSbdo-yC0Z-hXyx1-ep1Rn1KWau0BkSU4qw6Q&usqp=CAU" border="0" /></a></div>' ;
 banners[3] = '<div><a href="" target="_blank" /><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSW4XHAc_3e_m2S-bQFIjgrCWWSIfOCKrCDOw&usqp=CAU" border="0" /></a></div>' ;
 banners[4] = '<div><a href="" target="_blank" /><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcScIGatWRvdQvQ74YXqMuIZlw8zIHt0uaz0iA&usqp=CAU" border="0" /></a></div>' ;
 banners[5] = '<div><a href="" target="_blank" /><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRhg8TwksDw03khK8X87Tgs7AfWNPsGMYQbRA&usqp=CAU" border="0" /></a></div>' ;
 banners[6] = '<div><a href="" target="_blank" /><img src="/web/img/vip_06.jpg" border="0" /></a></div>' ;
  
 var bannerReq = new Array() ;
 var theOne ;
 var z=0 ;
 
 for (i=0; i<banners.length; i++){
  bannerReq[i] = i ;
 
  while (z<banners.length){
   theOne  = Math.floor(Math.random()*banners.length) ;
  
   if (banners[theOne]!="_selected!") {
   document.write(banners[theOne]) ;
   banners[theOne] = "_selected!" ;
                            z++ ;
                           }
    
  }
 }
 
</script>

 

 

</div>

 

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
전체 0
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT