위토즈 - 개발자프로그램판매공간

정보공유

[JQUERY] 탭으로 나눠지는 슬라이드 쇼


<link rel="stylesheet" href="<?php echo G5_CSS_URL;?>/swiper-bundle.min.css?ver=221113" />

<script src="<?php echo G5_JS_URL;?>/swiper.js?ver=221113"></script>

<style>

.tab_wrap {max-width: 800px;margin: 0 auto 0;padding: 0;}

.tab_wrap .tit_list {position: relative;font-size: 0;}

.tab_wrap .tit_list:before {content:'';position: absolute;bottom: 0;left: 0;width: 100%;height: 1px;background: #ddd;z-index: 1;}

.tab_wrap .tit_list > li {display: inline-block;vertical-align: top;margin-right: 3px;}

.tab_wrap .tit_list > li a {display: inline-block;padding: 10px 15px;border: 1px solid #fff;border-radius:4px 4px 0 0;font-size: 14px;color: #000;text-decoration: none;}

.tab_wrap .tit_list > li a:hover {background: #efefef;border-color: #efefef;}

.tab_wrap .tit_list > li.active a {position: relative;border-color: #ddd;border-bottom: 1px solid #fff;background: #fff;color: #337ab7;z-index: 2;}

.tab_wrap .tab_con {border: 1px solid #ddd;border-top: none;background-color:#000}

.tab_wrap .tab_con .mySwiper {display: none;padding:0px;}

.tab_wrap .tab_con .mySwiper:first-child {display:block;}

.tab_wrap .swiper-pagination {position:relative;bottom:0;padding:8px 0;}

.tab_wrap .swiper-slide {text-align:center}

</style>


<div class="tab_wrap">

    <!-- 탭메뉴 제목 -->

    <ul class="tit_list">

        <!-- 디폴트 선택 li에 active 클래스 추가 -->

        <li class="active"><a href="#mySwiper0">1번째 탭</a></li>

        <li><a href="#mySwiper1">2번째 탭</a></li>

        <li><a href="#mySwiper2">3번째 탭</a></li>

    </ul>


    <!-- 탭메뉴 컨텐츠 -->

    <div class="tab_con">


        <!-- Swiper -->

        <div id="mySwiper0" class="swiper mySwiper">

            <div class="swiper-wrapper">

                <div class="swiper-slide"><img src="<?php echo G5_IMG_URL;?>/card_news/01_01.jpg"></div>

                <div class="swiper-slide"><img src="<?php echo G5_IMG_URL;?>/card_news/01_02.jpg"></div>

                <div class="swiper-slide"><img src="<?php echo G5_IMG_URL;?>/card_news/01_03.jpg"></div>

            </div>

            <div class="swiper-button-next"></div>

            <div class="swiper-button-prev"></div>

            <div class="swiper-pagination"></div>

        </div>


        <!-- Swiper -->

        <div id="mySwiper1" class="swiper mySwiper">

            <div class="swiper-wrapper">

                <div class="swiper-slide"><img src="<?php echo G5_IMG_URL;?>/card_news/02_01.jpg"></div>

                <div class="swiper-slide"><img src="<?php echo G5_IMG_URL;?>/card_news/02_02.jpg"></div>

                <div class="swiper-slide"><img src="<?php echo G5_IMG_URL;?>/card_news/02_03.jpg"></div>

            </div>

            <div class="swiper-button-next"></div>

            <div class="swiper-button-prev"></div>

            <div class="swiper-pagination"></div>

        </div>


        <!-- Swiper -->

        <div id="mySwiper2" class="swiper mySwiper">

            <div class="swiper-wrapper">

                <div class="swiper-slide"><img src="<?php echo G5_IMG_URL;?>/card_news/01_07.jpg"></div>

                <div class="swiper-slide"><img src="<?php echo G5_IMG_URL;?>/card_news/01_08.jpg"></div>

                <div class="swiper-slide"><img src="<?php echo G5_IMG_URL;?>/card_news/01_09.jpg"></div>

            </div>

            <div class="swiper-button-next"></div>

            <div class="swiper-button-prev"></div>

            <div class="swiper-pagination"></div>

        </div>

    </div>

</div>



<script type="text/javascript">

<!--

    var swiperArr = new Array();

    $('.mySwiper').each(function(index){

        swiperArr[index] = new Swiper('#mySwiper'+index, {

            spaceBetween: 0,

            centeredSlides: true,

            autoplay:false,

            pagination: {

                el: $('#mySwiper'+ index).find('.swiper-pagination'),

                clickable: true,

                type : 'fraction',   //페이징 타입 설정(종류: bullets, fraction, progressbar)

            },

            navigation: {

              nextEl: $('#mySwiper'+ index).find('.swiper-button-next'),

              prevEl: $('#mySwiper'+ index).find('.swiper-button-prev'),

            },

        });

    });


    $(document).ready(function () {

        $(document).on('click', '.tab_wrap .tit_list > li a', function(e) {


            e.preventDefault();


            //초기화

            $('.tab_wrap .tit_list > li').removeClass('active');

            $('.tab_wrap .mySwiper').hide();


            //실행

            $(this).parent().addClass('active');

            var activeTab = $(this).attr('href');

            var idx = $(this).parent().index();


            $(activeTab).show();

            swiperArr[idx].update();

        });

    });

//-->

</script>


첨부파일

정보공유
Total 470건 1 페이지
번호 제목 글쓴이 날짜 조회
470 숫자를 입력하면 컴마단위로 찍히기. 숫자만 허용. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11:06 27
469 짧은 접수번호 생성. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 12-10 330
468 아이코드 토큰방식 모듈 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 12-05 521
467 HTML 파일을 CSS가 적용된 PDF로 변환하여 서버에 저장하는 PHP 코드 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 11-06 920
466 phpMyAdmin 접속이 안될때, db 아이피 포트번호 다를때. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 09-18 1,271
465 실패되었습니다.[연동오류(PHP SOAP 모듈설치 필요)] 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 09-10 1,384
464 csv 파일 만들때 제일많이 하는 실수!! 필드에 , 가 있는경우 변환이 제대로 안된다. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 09-01 1,556
463 GROUP_CONCAT 길이 제한 때문에 결과값을 다 못가져오는 경우 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 08-26 1,564
462 회원아이디 자동 생성 함수 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 08-20 1,699
461 중앙 토스트 레이어 , 버튼을 클릭하면 화면 중앙에 3초간 보였다가 fadeout 되는 레이어창. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 08-19 1,744
460 관리자 권한이 super 아니고 관리권한설정을 부여받은 회원이 관리자 화면에 접속했을때 부여받은 메뉴로 바로 접속되도록 처리 (2) 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 08-15 1,778
459 관리자 권한이 super 아니고 관리권한설정을 부여받은 회원이 관리자 화면에 접속했을때 부여받은 메뉴로 바로 접속되도록 처리 (1) 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 08-15 1,726
458 SQL 주입 방지 Prepared Statement 의 생활화 mysqli PDO 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 08-15 1,532
457 크로스 사이트 스크립팅(XSS) 테스트 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 08-12 1,753
456 2일전부터 오늘까지의 데이터 정보 가져오기. 위토즈쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 08-05 1,663