JSFiddle - React, Tailwind, and code Playground

Select for Ubigreen

by Zonedark

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.6/angular.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<div ng-controller="MyCtrl">
  <div style="width:800px;height:800px;background:rgb(238, 238, 238);overflow: auto">
    <div class="container">
      <dl id="sample" class="dropdown">
        <dt><a href="#"><span>Please select the country<i class="fa fa-chevron-down testicon"></i></span></a></dt>
        <dd>
          <ul>
            <li ng-repeat="country in Countries" ng-click="$parent.SelectedValue = country.Value">
              <a href="#">{{country.Name}}
                <i class="fa fa-chevron-down testicon"></i>
                  <span class="value">{{country.Value}}</span>
               </a>
            </li>
          </ul>
        </dd>
      </dl>
    </div>
    {{SelectedValue}}
  </div>
</div>

CSS

.container {
  width: 400px;
  margin-left: 30px;
  margin-top: 30px;
}

.testicon {
  position: absolute;
  right: 15px;
}

.desc {
  color: #6b6b6b;
}

.desc a {
  color: #0092dd;
}

.dropdown dd,
.dropdown dt,
.dropdown ul {
  margin: 0px;
  padding: 0px;
}

.dropdown dd {
  position: relative;
}

.dropdown a,
.dropdown a:visited {
  color: #816c5b;
  text-decoration: none;
  outline: none;
  position: relative;
}

.dropdown a:hover {
  color: #5d4617;
}

.dropdown dt a:hover,
.dropdown dt a:focus {
  border-bottom: 1px solid #00CC66;
}


/* @Main select bar */

.dropdown dt a {
  background: white no-repeat scroll right center;
  display: block;
  padding-right: 20px;
  border-bottom: 1px solid #00FF66;
  width: 100%;
  -webkit-border-top-left-radius: 2px;
  -webkit-border-top-right-radius: 2px;
  -moz-border-radius-topleft: 2px;
  -moz-border-radius-topright: 2px;
  border-top-left-radius: 2px;
  border-top-right-radius: 2px;
}

.dropdown dt a span {
  cursor: pointer;
  display: block;
  padding: 10px;
}


/* @options */

.dropdown dd ul {
  background: white none repeat scroll 0 0;
  border: none;
  color: #C5C0B0;
  display: none;
  left: 0px;
  position: absolute;
  top: 2px;
  width: 100%;
  list-style: none;
  -webkit-border-bottom-right-radius: 2px;
  -webkit-border-bottom-left-radius: 2px;
  -moz-border-radius-bottomright: 2px;
  -moz-border-radius-bottomleft: 2px;
  border-bottom-right-radius: 2px;
  border-bottom-left-radius: 2px;
}

.dropdown dd ul i {
  display: none;
}

.dropdown span.value {
  display: none;
}

.dropdown dd ul li a {
  padding: 5px;
  display: block;
}

.dropdown dd ul li a:hover {
  background-color: #66FF99;
}

.dropdown img.flag {
  border: none;
  vertical-align: middle;
  margin-left: 10px;
}

JavaScript

var myApp = angular.module('myApp', []);

myApp.controller('MyCtrl', ['$scope', function($scope) {
  $scope.name = "Angular";
  $scope.Countries = [{
    Name: "Brazil",
    Value: "BR"
  }, {
    Name: "France",
    Value: "FR"
  }, {
    Name: "Germany",
    Value: "DE"
  }, {
    Name: "India",
    Value: "IN"
  }, {
    Name: "Australia",
    Value: "AU"
  }, ];
}]);


$(document).ready(function() {

  $(".dropdown dt a").click(function() {
    $(".dropdown dd ul").toggle();
  });

  $(".dropdown dd ul li a").click(function() {
    var text = $(this).html();
    $(".dropdown dt a span").html(text);
    $(".dropdown dd ul").hide();
    $("#result").html("Selected value is: " + getSelectedValue("sample"));
  });

  function getSelectedValue(id) {
    return $("#" + id).find("dt a span.value").html();
  }

  $(document).bind('click', function(e) {
    var $clicked = $(e.target);
    if (!$clicked.parents().hasClass("dropdown"))
      $(".dropdown dd ul").hide();
  });


  $("#flagSwitcher").click(function() {
    $(".dropdown img.flag").toggleClass("flagvisibility");
  });
});