CSS with jquery landscaping select_jquery

Source: Internet
Author: User
A simple CSS matching JQ landscaping Select

Copy Code code as follows:

<div id= "Main" >
<section id= "Basic-usage" >
<select id= "Basic-usage-demo" >
<option value= "" > Please select ...</option>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</section>
</div>

Copy Code code as follows:

<script>
$ (document). Ready (function () {
$ (' #basic-usage-demo '). Fancyselect ();

Boilerplate
var reponame = ' Fancyselect '

$.get (' + reponame, function (repo) {
var el = $ (' #top '). Find ('. Repo ');

El.find ('. Stars '). Text (Repo.watchers_count);
El.find ('. Forks '). Text (Repo.forks_count);
});

var menu = $ (' #top '). Find (' menu ');

function Positionmenuarrow () {
var current = Menu.find ('. Current ');

Menu.find ('. Arrow '). css (' left ', Current.offset (). Left + (Current.outerwidth ()/2));
}

$ (window). On (' Resize ', positionmenuarrow);

Menu.on (' Click ', ' a ', function (e) {
var el = $ (this),
href = el.attr (' href '),
Currentsection = $ (' #main '). Find ('. Current ');

E.preventdefault ();

Menu.find ('. Current '). Removeclass (' current ');

El.addclass (' current ');

Positionmenuarrow ();

if (currentsection.length) {
Currentsection.fadeout. Promise (). Done (function () {
$ (HREF). addclass (' current '). FadeIn (300);
});
} else {
$ (HREF). addclass (' current '). FadeIn (300);
}
});

Menu.find (' A:first '). Trigger (' click ')
});
</script>

Copy Code code as follows:

<style type= "Text/css" >

Div#main {font-size:16px; line-height:26px; color: #fff;}
Div#main div.fancy-select {margin:0 auto 60px; width:200px;}

</style>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.