designSelect.js

브라우저 종류에 관계 없이 select box에 스타일을 적용할 수 있게 해주는 플러그인

샘플영상

다운로드

designSelect.js V1.3 다운로드

설치/사용법

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="/js/designSelect_1.3.js"></script>

<style>
body{font-size:12px;}
select{
    width:160px;
    height:26px;
    box-sizing: border-box;
}
.designSelect{
    position:relative;
    display:inline-block;
    cursor:pointer;
    border:1px solid #e2e2e4;
    border-radius: 4px;
    z-index: 10;
}
.designSelect .box{
}
.designSelect .box::after{
    content:"f107";
    font-family: "FontAwesome";
    position:absolute;
    right:10px;
    font-size:14px;
}
.designSelect .option_container{
    position:absolute;
    display:none;
    left:0px;
    height:0;
    border:1px solid #e2e2e4;
    border-radius:4px;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    background: #fff;
}
.designSelect .option_container .option{
    background:#fff;
    text-align: left;
    color:#bdbdbd;
    border-radius: 4px;
}
.designSelect .option_container .option:hover{
    background:#f1f1f1;
    color:#797979;
}

</style>


<script>

$(function(){
    
    $('body').designSelect();
        
});    


</script>

<body>

    <select name="option">
        <option value='1'>옵션1</option>
        <option value='2'>옵션2</option>
    </select>


</body>

 

1. 제이쿼리를 설치가 필요 합니다.

 

 

 

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="/js/designSelect_1.3.js"></script>

<style>
body{font-size:12px;}
select{
    width:160px;
    height:26px;
    box-sizing: border-box;
}
.designSelect{
    position:relative;
    display:inline-block;
    cursor:pointer;
    border:1px solid #e2e2e4;
    border-radius: 4px;
    z-index: 10;
}
.designSelect .box{
}
.designSelect .box::after{
    content:"f107";
    font-family: "FontAwesome";
    position:absolute;
    right:10px;
    font-size:14px;
}
.designSelect .option_container{
    position:absolute;
    display:none;
    left:0px;
    height:0;
    border:1px solid #e2e2e4;
    border-radius:4px;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    background: #fff;
}
.designSelect .option_container .option{
    background:#fff;
    text-align: left;
    color:#bdbdbd;
    border-radius: 4px;
}
.designSelect .option_container .option:hover{
    background:#f1f1f1;
    color:#797979;
}

</style>


<script>

$(function(){
    
    $('body').designSelect();
        
});    


</script>

<body>

    <select name="option">
        <option value='1'>옵션1</option>
        <option value='2'>옵션2</option>
    </select>


</body>

 

2. 다운로드 받은 플러그인을 설치 합니다.

 

 

 

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="/js/designSelect_1.3.js"></script>

<style>
body{font-size:12px;}
select{
    width:160px;
    height:26px;
    box-sizing: border-box;
}
.designSelect{
    position:relative;
    display:inline-block;
    cursor:pointer;
    border:1px solid #e2e2e4;
    border-radius: 4px;
    z-index: 10;
}
.designSelect .box{
}
.designSelect .box::after{
    content:"f107";
    font-family: "FontAwesome";
    position:absolute;
    right:10px;
    font-size:14px;
}
.designSelect .option_container{
    position:absolute;
    display:none;
    left:0px;
    height:0;
    border:1px solid #e2e2e4;
    border-radius:4px;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    background: #fff;
}
.designSelect .option_container .option{
    background:#fff;
    text-align: left;
    color:#bdbdbd;
    border-radius: 4px;
}
.designSelect .option_container .option:hover{
    background:#f1f1f1;
    color:#797979;
}

</style>


<script>

$(function(){
    
    $('body').designSelect();
        
});    


</script>

<body>

    <select name="option">
        <option value='1'>옵션1</option>
        <option value='2'>옵션2</option>
    </select>


</body>

 

2. select 태그에 적용 시킬 스타일을 작성 합니다.

 

 

 

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="/js/designSelect_1.3.js"></script>

<style>
body{font-size:12px;}
select{
    width:160px;
    height:26px;
    box-sizing: border-box;
}
.designSelect{
    position:relative;
    display:inline-block;
    cursor:pointer;
    border:1px solid #e2e2e4;
    border-radius: 4px;
    z-index: 10;
}
.designSelect .box{
}
.designSelect .box::after{
    content:"f107";
    font-family: "FontAwesome";
    position:absolute;
    right:10px;
    font-size:14px;
}
.designSelect .option_container{
    position:absolute;
    display:none;
    left:0px;
    height:0;
    border:1px solid #e2e2e4;
    border-radius:4px;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    background: #fff;
}
.designSelect .option_container .option{
    background:#fff;
    text-align: left;
    color:#bdbdbd;
    border-radius: 4px;
}
.designSelect .option_container .option:hover{
    background:#f1f1f1;
    color:#797979;
}

</style>


<script>

$(function(){
    
    $('body').designSelect();
        
});    


</script>

<body>

    <select name="option">
        <option value='1'>옵션1</option>
        <option value='2'>옵션2</option>
    </select>


</body>

 

3. 페이지가 열릴때 자동으로 실행되게 함수를 작성 합니다.

 

 

 

 

* 플러그인 설치는 지원하지는 않습니다.
위로

잠시만 기다려주세요.