Skip to content

Instantly share code, notes, and snippets.

@DevShahidul
Last active November 17, 2017 20:16
Show Gist options
  • Select an option

  • Save DevShahidul/ba3a15925cbc54fa32912e95b71c5882 to your computer and use it in GitHub Desktop.

Select an option

Save DevShahidul/ba3a15925cbc54fa32912e95b71c5882 to your computer and use it in GitHub Desktop.
See here >>> http://manos.malihu.gr/jquery-custom-content-scroller/
Custom scroll bar with custom scripting see here >>> http://www.jankoatwarpspeed.com/reinventing-a-drop-down-with-css-and-jquery/
<!-- html markut -->
<div class="selectrick-wraper" id="selectrick-wraper">
<span><img src="images/rating-5.png"></span>
<ul>
<li class="five-star"><img src="images/rating-5.png"></li>
<li class="four-star"><img src="images/rating-4.png"></li>
<li class="three-star"><img src="images/rating-3.png"></li>
<li class="two-star"><img src="images/rating-2.png"></li>
<li class="one-star"><img src="images/rating-1.png"></li>
</ul>
</div>
<!-- css Style -->
.selectrick-wraper{float: left; width: 100%; position: relative;}
.selectrick-wraper span{float: left; border: 0; height: 35px; line-height: 13px; background: #ffffff; width: 100%; padding: 11px; position: relative; padding-right: 50px; cursor: pointer;}
.selectrick-wraper span:before{background-image: url(../images/selectric-dropdown-arrow.png); height: 35px; background-position: center; background-repeat: no-repeat; content: ""; position: absolute; right: 0; top: 0; width: 38px}
.selectrick-wraper ul{float: left; width: 100%; position: absolute; left: 0; top: 45px; background: #ffffff; padding: 5px 0; border: 1px solid #ededed; -webkit-box-shadow: 1px 1px 20px 1px rgba(0,0,0,0.18); -moz-box-shadow: 1px 1px 20px 1px rgba(0,0,0,0.18); box-shadow: 1px 1px 20px 1px rgba(0,0,0,0.18); display: none;}
.selectrick-wraper ul li{float: left; width: 100%; border-bottom: 1px solid #ededed; padding: 10px 11px; cursor: pointer;}
.selectrick-wraper ul li:last-child{border-bottom: 0;}
<!-- scripting -->
$(".selectrick-wraper span").click(function(){
$(this).parent().find("ul").toggle()
})
$(".selectrick-wraper ul li").click(function(){
var elementItem = $(this).html()
$(".selectrick-wraper span").html(elementItem)
$(this).parent().hide()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment