부드럽게 열리는 상자

백업/자료 2024. 12. 29.
$(".more_open_close").click(function(){
	if($(this).next().hasClass('more_content_box')){
		 $(this).next().slideToggle(function(){
			var txt=$(this).prev();
			if(txt.text()=="열기"){
				txt.text("접기");
			}else if(txt.text()=="접기"){
				txt.text("열기");
			}
		 });
	}else{
		$(this).parents('p').siblings('.more_content_box').slideToggle(function(){
		var txt=$(this).prev().find('.more_open_close');
		if(txt.text()=="열기"){
			txt.text("접기");
		}else if(txt.text()=="접기"){
			txt.text("열기");
		}	
		});
	}
	return false;
});

 

아보카도 에디션에 기본적으로 있는 이 코드를 사용해서...(위치는 js의 _custom? 일거임)

 

<a href="#" class="more_open_close ui-btn point ">
<span style="color: rgb(90, 80, 75);">버튼명</span>
</a>
<div class="more_content_box" style="display: none;">내용</div>

최근 글

캘린더

    2 / 2025
    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