Notice
Recent Posts
Recent Comments
Link
관리 메뉴

web sprit

[jQuery] flow banner (흐르는 배너, footer banner) 본문

스크립트/Source

[jQuery] flow banner (흐르는 배너, footer banner)

커드만 2016. 8. 29. 12:14

대부분 관공서나 공단 사이트를 보면 하단 footer 부분에 흐르는 배너를 볼 수 있습니다.

저는 이 명칭을 flow banner라고 멋데로 짓고 나중을 위해 소스를 올리려 합니다.


소스는 다음과 같습니다.


HTML

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!-- footer_banner -->
<div class="footer_banner_zone">
    <h3 class="blind">관련사이트</h3>
 
    <!-- banner -->
    <div class="flow_banner_box">
        <div id="banner" class="flow_bann_area">
            <ul>
                <li>
                    <a href="#">
                        <img src="./images/footer_banner_img_01.jpg" alt="banner_01" />
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="./images/footer_banner_img_02.jpg" alt="banner_02" />
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="./images/footer_banner_img_03.jpg" alt="banner_03" />
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="./images/footer_banner_img_04.jpg" alt="banner_04" />
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="./images/footer_banner_img_05.jpg" alt="banner_05" />
                    </a>
                </li>
 
                <li>
                    <a href="#">
                        <img src="./images/footer_banner_img_06.jpg" alt="banner_06" />
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="./images/footer_banner_img_07.jpg" alt="banner_07" />
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="./images/footer_banner_img_01.jpg" alt="banner_01" />
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="./images/footer_banner_img_02.jpg" alt="banner_02" />
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="./images/footer_banner_img_03.jpg" alt="banner_03" />
                    </a>
                </li>
            </ul>
        </div>
 
        <!-- controll -->
        <div class="flow_ctrl_box">
            <a href="#" id="banner_left" class="back"><span class="blind">이전</span></a>
            <a href="#" id="banner_right" class="next"><span class="blind">다음</span></a>
            <a href="#" id="banner_play" class="play"><span class="">재생</span></a>
            <a href="#" id="banner_pause" class="stop"><span class="">멈춤</span></a>
        </div>
        <!-- //controll -->
    </div>
    <!-- //banner -->
 
</div>
<!-- //footer_banner -->
cs



CSS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* banner */
.footer_banner_zone{position:relative; width:100%; background:#f8f8f8; padding:15px 0;}
.footer_banner_zone .flow_banner_box{position:relative; width:1000px; margin:0 auto; background:#fff; height:66px;}
.footer_banner_zone .flow_banner_box .flow_bann_area{position:absolute; top:8px; left:50%; margin-left:-447px;}
.footer_banner_zone .flow_banner_box .flow_bann_area ul{*zoom:1;}
.footer_banner_zone .flow_banner_box .flow_bann_area ul:after{content:""; display:block; clear:both;}
.footer_banner_zone .flow_banner_box .flow_bann_area ul li{float:left; padding-right:9px;}
.footer_banner_zone .flow_banner_box .flow_bann_area ul li a{}
.footer_banner_zone .flow_banner_box .flow_bann_area ul li a img{border:1px solid #f2f2f2;}
/* btn */
.flow_ctrl_box{}
.flow_ctrl_box a{position:absolute; top:20px;  width:16px; height:26px; background-image:url(./images/flow_ctrl_side_btn.gif);}
.flow_ctrl_box a.back{left:18px; background-position:0 0;}
.flow_ctrl_box a.next{right:18px; background-position:16px 0;}
.flow_ctrl_box a.play{background:none; width:auto; height:auto; top:0; left:-30px; font-size:13px; color:#fff; background:#333; border-radius:15px; text-decoration:none; padding:5px 10px;}
.flow_ctrl_box a.stop{background:none; width:auto; height:auto; top:31px; left:-30px; font-size:13px; color:#fff; background:#333; border-radius:15px; text-decoration:none; padding:5px 10px;}
cs



JavaScript

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
jQuery(function() {
 
    $("#banner ul").carouFredSel({
        align : "left",
        width : 896// 가로길이
        height : 51// 세로길이
        items : {
        visible : 6 // 보여지는 갯수 (5개가 보여진다면 +1을 하여 버블링 효과를 막는다.)
        },
        scroll : {
        items : 1// 롤링넘어가는 갯수
        duration : 800//롤링 속도
        pauseOnHover : false // 마우스 오버시 롤링멈춤 true, 롤링작동 false
        },
        next : "#banner_right"// 오른쪽으로 이동 버튼
        prev : "#banner_left"// 왼쪽으로 이동 버튼
        direction : "left" // 롤링 방향
    });
 
    $("#banner_pause").click(function(){
        $("#banner ul").trigger("pause");
        $("#banner_stop").hide();
        $("#banner_start").show();
        return true;
    });
 
    $("#banner_play").click(function(){
        $("#banner ul").trigger("play"1);
        $("#banner_stop").show();
        $("#banner_start").hide();
        return true;
    });
 
});
cs



View



File


참고하여 사용 바랍니다. ^^

'스크립트 > Source' 카테고리의 다른 글

[jQuery] checkbox 전체 선택 및 취소  (0) 2016.10.18
[JavaScript] window.open() - 팝업 만들기  (2) 2016.07.27
Comments