미채택 완료

영카트5 제이쿼리 질문 입니다.

2015-08-11 (화) 09:17:40 2,151
Copy
<script>$(function (){    var $category = $("#category");    $("#hd_ct").on("click", function() {        $category.css("display","block");    });    $("#category .pop_close").on("click", function(){        $category.css("display","none");    });    $("button.sub_ct_toggle").on("click", function() {        var $this = $(this);        $sub_ul = $(this).closest("li").children("ul.sub_cate");        if($sub_ul.size() > 0) {            var txt = $this.text();            if($sub_ul.is(":visible")) {                txt = txt.replace(/닫기$/, "열기");                $this                    .removeClass("ct_cl")                    .text(txt);            } else {                txt = txt.replace(/열기$/, "닫기");                $this                    .addClass("ct_cl")                    .text(txt);            }            $sub_ul.toggle();        }    });});</script>​
 

현재 영카트5에서 사용되고 있는 카테고리 부분 입니다.

여기에서 토글이 열리고 닫힐때 좌측에서 슬라이드 형태로...

나타나게 해보고 싶은데...

$(this).next().slideDown("fast");

이런 식으로 사용하고 싶은데...

생각처럼 되지가 않네요 ㅠ

조언 부탁 드립니다.

|

답변을 작성하려면 로그인이 필요합니다.