펼침목록 만들기...

펼침목록 만들기...

QA

펼침목록 만들기...

본문

https://brand.gcoop.com/ko/

3068534878_1721660794.3154.png

 

이렇게 만들어주실 분 계시나요??

이 질문에 댓글 쓰기 :

답변 2

아래 코드 사용 시 아래 움짤과 같은 결과를 얻을 수 있으며, 그 이외 내용은 직접 수정 하시길 바랍니다.

 

 

 


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
        }
        .select {
            width: 300px;
            margin: 50px auto;
            background-color: #fff;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            overflow: hidden;
        }
        .select_arrow {
            margin-left: 10px;
            transition: transform 0.3s;
        }
        .select p {
            margin: 0;
            padding: 15px;
            background-color: #007bff;
            color: #fff;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .select p img {
            transition: transform 0.3s;
        }
        .select ul {
            list-style: none;
            margin: 0;
            padding: 0;
            display: none;
            max-height: 252px;
            overflow-y: auto;
        }
        .select ul li {
            border-top: 1px solid #ddd;
        }
        .select ul li a {
            display: block;
            padding: 10px 15px;
            color: #333;
            text-decoration: none;
            transition: background-color 0.3s;
        }
        .select ul li a:hover {
            background-color: #f1f1f1;
        }
    </style>
    <script>
        $(document).ready(function(){
            $('.select p').on('click', function(){
                var ul = $(this).next('ul');
                var arrow = $(this).find('.select_arrow');
                if (ul.is(':visible')) {
                    ul.slideUp();
                    arrow.css('transform', 'rotate(0deg)');
                } else {
                    ul.slideDown();
                    arrow.css('transform', 'rotate(180deg)');
                }
            });
        });
    </script>
</head>
<body>
    <div class="select">
        <p>셀렉트 <span class="select_arrow">▼</span></p>
        <ul>
            <li><a href="http://www.naver.com" target="_blank">Naver</a></li>
            <li><a href="http://www.google.com" target="_blank">Google</a></li>
            <li><a href="http://www.daum.net" target="_blank">Daum</a></li>
        </ul>
    </div>
</body>
</html>
답변을 작성하시기 전에 로그인 해주세요.
전체 0
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT