열기 닫기 아코디언(?) 토글(?) 형식 배너 만들기 정보
열기 닫기 아코디언(?) 토글(?) 형식 배너 만들기본문
입맛에 맞게 css나 마크업 수정하시면 될 것 같습니다.
<style>
/* Floating style start */
.FloatingWrap{position: fixed;bottom: 0;left: 0;width: 100%;background: #f00;z-index: 100;}
.FloatingBox{}
.FloatingOpen{text-align: right;position: relative;padding: 5px 50px;}
.FloatingOpen span{cursor:pointer;width: 100px;height: 70px;text-align: center;display: inline-flex;justify-content: center;align-items: center;background: #000;color:#fff}
.FloatingOpen #FloatingOpenBtn{color:#fff;}
.FloaingDB{display: none;background: #ddd;height: 250px;}
/* Floating style end */
</style>
<div class="FloatingWrap">
<div class="FloatingBox">
<div class="FloatingOpen">
<span>
<div id="FloatingText">열기</div>
<img id="FloatingOpenBtn" src="<?php echo G5_THEME_IMG_URL ?>/FloatingArrowDown.png"">
</span>
</div>
<div class="FloaingDB">
asd
</div>
</div>
</div>
<script>
$(function () {
$(".FloatingOpen span").on("click", function() {
$(".FloaingDB").slideToggle("fast", function() {
var image = $("#FloatingOpenBtn");
var text = $("#FloatingText");
if (image.attr("src").includes("FloatingArrowDown.png")) {
image.attr("src", "<?php echo G5_THEME_IMG_URL ?>/FloatingArrowUp.png");
text.text("닫기");
} else {
image.attr("src", "<?php echo G5_THEME_IMG_URL ?>/FloatingArrowDown.png");
text.text("열기");
}
image.fadeIn(2050);
});
});
});
</script>
추천
5
5
댓글 4개
좋아요, 감사 합니다.
감사 합니다.
좋은자료~~ 감사합니다~~
좋아요!! 감사합니다