팁 공유 관련 궁금하신 사항이 있으면 이곳에 질문 해주세요.
검색을 해보시면 원하는 답을 찾을수도 있답니다.
팁관련 답변은 누구나 하실 수 있습니다.
  • 웹미니 한줄 전광판 영역 입니다.
글 수 905

10

조회 수 : 1588 신고 : 0

작성자 : 허미정
포인트 : 35 | 레벨 : 0
<script language="javascript">
//Math.random()

        var scrollerheight=610;                // 스크롤러의 세로
        var html,total_area=0,wait_flag=true;
        
        var bMouseOver = 1;
        var scrollspeed = 1;                // Scrolling 속도        
        var waitingtime = 3000;                // 멈추는 시간
        var s_tmp = 0, s_amount = 122;
        var scroll_content=new Array();
        var startPanel=0, n_panel=0, i=0;
        
        function startscroll()
        { // 스크롤 시작
                i=0;
                for (i in scroll_content)
                        n_panel++;
                        
                n_panel = n_panel -1 ;
                startPanel = Math.round(Math.random()*n_panel);
                if(startPanel == 0)
                {
                        i=0;
                        for (i in scroll_content)
                                insert_area(total_area, total_area++);
                }
                else if(startPanel == n_panel)
                {
                        insert_area(startPanel, total_area);
                        total_area++;
                        for (i=0; i<startPanel; i++)
                        {
                                insert_area(i, total_area);
                                total_area++;
                        }
                }
                else if((startPanel > 0) || (startPanel < n_panel))
                {
                        insert_area(startPanel, total_area);
                        total_area++;
                        for (i=startPanel+1; i<=n_panel; i++)
                        {
                                insert_area(i, total_area);
                                total_area++;
                        }
                        for (i=0; i<startPanel; i++)
                        {
                                insert_area(i, total_area);
                                total_area++;
                        }
                }
                window.setTimeout("scrolling()",waitingtime);
        }
        function scrolling(){ // 실제로 스크롤 하는 부분
                if (bMouseOver && wait_flag)
                {
                        for (i=0;i<total_area;i++){
                                tmp = document.getElementById('scroll_area'+i).style;
                                tmp.top = parseInt(tmp.top)-scrollspeed;
                                if (parseInt(tmp.top) <= -scrollerheight){
                                        tmp.top = scrollerheight*(total_area-1);
                                }
                                if (s_tmp++ > (s_amount-1)*scroll_content.length){
                                        wait_flag=false;
                                        window.setTimeout("wait_flag=true;s_tmp=0;",waitingtime);
                                }
                        }
                }
                window.setTimeout("scrolling()",1);
        }
        function insert_area(idx, n){
                html='<div style="left: 0px; width: 100%; position: absolute; top: '+(scrollerheight*n)+'px" id="scroll_area'+n+'">n';
                html+=scroll_content[idx]+'n';
                html+='</div>n';
                document.write(html);
        }


    // 스크롤 내용
    <?
    $id = "song2"; //불러낼 게시판 이름
    $result = @mysql_query("select * from zetyx_board_$id where is_secret!='1' order by no desc limit 10"); // 최근에 게시된 게시물 중에서 10개만 뽑아와서 출력함
    $result_category = @mysql_query("select * from zetyx_board_category_$id");
    $i = 0;$j = 0;
    while($data=@mysql_fetch_array($result))        {
        $subject = cut_str(stripslashes($data[subject]),10)."</font></b>";
        if($i==0) {
            echo "scroll_content[".$j."]="";
        }
        echo "<table cellpadding=0 cellspacing=0><tr><td height=102><a href='./bbs/view.php?id=$id&no=$data[no]'><img src=$_zb_path".$data[file_name2]." width=100 height=100 border=1 style='border-color:#999999'></td></tr><tr><td height=20 align=center><a href='./bbs/view.php?id=$id&no=$data[no]'>".$subject."</a></td></tr></table>";
        $i++;
        if($i==5) { //불러낼 최근게시제목 수
            echo "";nt";
            $i = 0; $j++;
        }
    }
    ?>
</script>

-----------------------------------------------------------------------

안녕하세요..위 소스는 아시겠지만
Goccm 님 스크롤 겔러리인데요...
게시물에 이미지를 업로드 안했을때 그냥 no image 로 출력하는
방법을 알고 싶습니다.초보라 혼자 하기에 넘 힘드네요..
게시물에 이미지를 업로드를 하지 않으면 자꾸 에러가 떠서..
10개정도를 항상 유지해야 하거든요..
그럼 항상 건강하시고 행복 하세요..
Goccm 님 홈에 질문 드렸는데...요즘 넘 바쁘셔서
백짱구님은 아실만한 실력 같아서리 염치불고 하고 질문 올립니다.
죄송합니다.

------------------------------------------------------------------------

소중한 댓글 부탁드립니다.
추천수 10단위당 메달이 1개씩 노출되고, 추천수에 따라 배경색이 변하며, 일정수의 추천수를 받을시 BEST 아이콘이 붙게됩니다.
추천수에 따른 배경색 보기 본문으로 바로가기
  • 추천수 50개이상
  • 추천수 30개이상
  • 추천수 20개이상
  • 추천수 10개이상
  • 추천수 3개이상
닫기

댓글 '2'

profile
title: [ani]깜빡이는 표정빽짱구 (15159)

2004.09.02 01:29:19

저도 그부분에 대해선 잘모르겠습니다.
위에 스킨은 최근겔러리물을 뽑아오는 스킨인데.. 당연히 사진을 업로드 해야된다고 생각하는데.. 만약 사진을 안올리게 될경우에도 사진을 업로드 하시는게 좋을듯합니다.(Goccm)님에 답변이 있을때까지...
허미정 (15160)

2004.09.02 22:20:22

작성자
네 답변 고마웠습니다.
항상 좋은일만 있으시길..
List of Articles
번호 제목 글쓴이 날짜 조회 수
205 홈페이지 만드는중 top메뉴 그림이 이상하게 안맞습니다...ㅠ.ㅠ [3] 이종섭 2004-09-22 1759
204 지식KIN이무슨뜻??? [1] DarkFun 2004-09-21 1656
203 빽짱구님 MSN메신저 자주들어오시나요?? [1] NewCan 2004-09-16 1542
202 제로보드 질문입니다. [4] 순두부 2004-09-14 1523
201 질문이요 'ㅈ'/ [1] 웅쓰 2004-09-10 1528
200 잘 이해가'ㅈ';; 웅쓰 2004-09-11 1536
199 [re] 잘 이해가'ㅈ';; [1] title: [ani]깜빡이는 표정빽짱구 2004-09-11 1537
198 자기소개 [4] title: [ani]보라색 나비바비인형 2004-09-08 1643
197 최근게시물iframe에 관하여 [1] 코난 2004-09-03 1592
196 저도 질문입니다.. [2] 대한민국 2004-09-03 1531
195 정말 죄송한데요..질문좀요.. [2] 허미정 2004-09-01 1588
194 짱구님 설문조사 스킨이요 ㅠ_ㅠ [1] 웅쓰 2004-09-01 1535
193 이미지 닉네임에관한 질문 [2] Spona 2004-09-01 1531
192 인터넷 주소 안에 아이콘 넣는 방법 [5] title: [ani]보라색 나비바비인형 2004-08-31 1887
191 알려주세요~ㅡㅜ [1] bunny 2004-08-30 1529
190 [re] 알려주세요~ㅡㅜ [3] title: [ani]깜빡이는 표정빽짱구 2004-08-30 1551
189 짱구님아 ....... 질문이요... [2] Spona 2004-08-30 1486
188 질문 있어욤~ ^^ [1] doro 2004-08-30 1446
187 또다시 오랜만에 다시 한번 질문을 [4] 김종창 2004-08-29 1523
186 질문인데요..ㅠㅜ [1] 대한민국 2004-08-28 3289