一个简单的css配合jq美化select
<script> <br>$(document).ready(function() { <br>$('#basic-usage-demo').fancySelect(); <br><br>// Boilerplate <br>var repoName = 'fancyselect' <br><br>$.get('' repoName, function(repo) { <br>var el = $('#top').find('.repo'); <br><br>el.find('.stars').text(repo.watchers_count); <br>el.find('.forks').text(repo.forks_count); <br>}); <br><br>var menu = $('#top').find('menu'); <br><br>function positionMenuArrow() { <br>var current = menu.find('.current'); <br><br>menu.find('.arrow').css('left', current.offset().left (current.outerWidth() / 2)); <br>} <br><br>$(window).on('resize', positionMenuArrow); <br><br>menu.on('click', 'a', function(e) { <br>var el = $(this), <br>href = el.attr('href'), <br>currentSection = $('#main').find('.current'); <br><br>e.preventDefault(); <br><br>menu.find('.current').removeClass('current'); <br><br>el.addClass('current'); <br><br>positionMenuArrow(); <br><br>if (currentSection.length) { <br>currentSection.fadeOut(300).promise().done(function() { <br>$(href).addClass('current').fadeIn(300); <br>}); <br>} else { <br>$(href).addClass('current').fadeIn(300); <br>} <br>}); <br><br>menu.find('a:first').trigger('click') <br>}); <br></script>