I have a select element that I have styled with up and down arrows. However, I am seeking assistance to navigate the options dropdown solely using these arrows and hide the dropdown list.
Here is the HTML:
<div class="select_wrap">
<div class="select_arow_wrap">
<span id="select-up" class="select-up"></span>
<span id="select-down" class="select-down"></span>
</div>
<div class="select_bg">
<select id="select">
<option value="Newzealand">Newzealand</option>
<option value="India">India</option>
<option value="United States">United States</option>
<option value="United Kingdom">United Kingdom</option>
</select>
</div>
</div>
The CSS:
.select_bg {
background-image:url(../images/select-bg.png);
background-repeat:repeat-x;
border:1px solid #dddedf;
background-position:left center;
background-color:transparent;
width:100%;
border-radius:5px;
padding:5px;
height:33px;
}
.select_wrap {
position:relative;
float:left;
width:100%;
overflow:hidden;
margin:5px;
}
.form_wrap form select {
background-color:transparent;
width:105%;
padding:3px;
top:0;
position:absolute;
-moz-appearance:none;
-webkit-appearance: none;
appearance: none;
margin:0;
height:30px;
}
.form_wrap form select option {
display:none;
}
.form_wrap form select::-ms-expand {
display: none;
}
.select_arow_wrap {
border-left:1px solid #dddedf;
float:left;
position:absolute;
width:16px;
height:30px;
right:5px;
top:2px;
padding:2px;
z-index:999;
}
.select-up,
.select-down{
background-repeat:no-repeat;
float:left;
width:14px;
height:13px;
cursor:pointer;
}
.select-up {
background-image:url(../images/select_up_arw.png);
right:-10px;
top:6px;
}
.select_wrap .select-down {
background-image:url(../images/select_dnw_arw.png);
right:-9px;
bottom:8px;
}
View the design here:
I am looking for a jQuery solution to navigate the options by clicking the arrows. Thank you in advance!