배너 램덤으로 부여주기

by 조쉬 posted Mar 01, 2014
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄
<script language="JavaScript">

                        function random_imglink(){
                        var myimages=new Array()

                        // 이미지들을 차례대로 설정 하세요
                        myimages[1]="http://njoy4you.com/hub/admin/image/20060413091939.gif"
                        myimages[2]="http://blogimgs.naver.com/imgs/noimage.gif"

                        // 각 이미지별 링크를 차례대로 설정 하세요
                        var imagelinks=new Array()
                        
                        imagelinks[1]="http://njoy4you.com"
                        imagelinks[2]="http://blog.naver.com/ghddntkd"

                        var ry=Math.floor(Math.random()*myimages.length)
                
                        if (ry==0)
                                ry=1
                                document.write('<a href='+imagelinks[ry]+' target=_blank><img src='+myimages[ry]+' border=0></a>')
                                }
                                random_imglink()
                </script>