Giter Site home page Giter Site logo

djscias / bootstrap-select-country Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mojoaxel/bootstrap-select-country

0.0 1.0 0.0 564 KB

countrypicker is a jQuery plugin that utilizes Bootstrap's dropdown.js and bootstrap-select to provide country data and styling to standard select elements.

Home Page: https://mojoaxel.github.io/bootstrap-select-country/index.html

License: MIT License

HTML 92.51% JavaScript 7.49%

bootstrap-select-country's Introduction

bootstrap-select-country

based on the popular bootstrap-select bootstrap-select-country examples

bootstrap-select-country is a jQuery plugin that utilizes Bootstrap's dropdown.js and bootstrap-select to provide country data and styling to standard select elements.

Dependencies

Usage

Create your <select> with the .selectpicker and .countrypicker class. The data-api from bootstrap-select will automatically apply a basic theme to these elements. Then the data-api from countrypicker will populate the select with countries.

<select class="selectpicker countrypicker"></select>

Minimal example

Here is a minimal example:

<!DOCTYPE html>
<html>
<head>
  <title>JS Bin</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  
  <link rel="stylesheet" href="//unpkg.com/[email protected]/dist/css/bootstrap.min.css" type="text/css" />
  <link rel="stylesheet" href="//unpkg.com/[email protected]/dist/css/bootstrap-select.min.css" type="text/css" />
  <link rel="stylesheet" href="//unpkg.com/[email protected]/dist/css/bootstrap-select-country.min.css" type="text/css" />

  <script src="//unpkg.com/[email protected]/dist/jquery.min.js"></script>
  <script src="//unpkg.com/[email protected]/dist/js/bootstrap.min.js"></script>
  <script src="//unpkg.com/[email protected]/dist/js/bootstrap-select.min.js"></script>
  <script src="//unpkg.com/[email protected]/dist/js/bootstrap-select-country.min.js"></script>
  
</head>
<body>
  <select class="selectpicker countrypicker" data-flag="true" ></select>

  <script>
    $('.countrypicker').countrypicker();
  </script>
  
</body>
</html>

Copyright and license

Copyright (C) 2017-2018 country-picker

Licensed under the MIT license.

FAQ

Bootstrap 4 beta-2

Bootstrap-select is still incompatible (ver. 1.12.4) with Bootstrap 4 beta-2. Include an additional CSS file, or put the following between <style></style> tags on the page you're displaying the country-picker on:

/*
Make bootstrap-select work with bootstrap 4 see:
https://github.com/silviomoreto/bootstrap-select/issues/1135
*/
.dropdown-toggle.btn-default {
  color: #292b2c;
  background-color: #fff;
  border-color: #ccc;
}
.bootstrap-select.show > .dropdown-menu > .dropdown-menu {
  display: block;
}
.bootstrap-select > .dropdown-menu > .dropdown-menu li.hidden {
  display: none;
}
.bootstrap-select > .dropdown-menu > .dropdown-menu li a {
  display: block;
  width: 100%;
  padding: 3px 1.5rem;
  clear: both;
  font-weight: 400;
  color: #292b2c;
  text-align: inherit;
  white-space: nowrap;
  background: 0 0;
  border: 0;
  text-decoration: none;
}
.bootstrap-select > .dropdown-menu > .dropdown-menu li a:hover {
  background-color: #f4f4f4;
}
.bootstrap-select > .dropdown-toggle {
  width: 100%;
}
.dropdown-menu > li.active > a {
  color: #fff !important;
  background-color: #337ab7 !important;
}
.bootstrap-select .check-mark {
  line-height: 14px;
}
.bootstrap-select .check-mark::after {
  font-family: "FontAwesome";
  content: "\f00c";
}
.bootstrap-select button {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Make filled out selects be the same size as empty selects */
.bootstrap-select.btn-group .dropdown-toggle .filter-option {
  display: inline !important;
}

bootstrap-select-country's People

Contributors

juuuuln avatar mojoaxel avatar saganic avatar vladimirbiro avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.