Home > Web Front-end > JS Tutorial > css cooperates with jquery to beautify select_jquery

css cooperates with jquery to beautify select_jquery

WBOY
Release: 2016-05-16 17:11:32
Original
1351 people have browsed it

A simple css with jq beautification select
css cooperates with jquery to beautify select_jquery

Copy code The code is as follows:







Copy code The code is as follows:

<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>

Copy code The code is as follows:


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template