Skip to content

Commit

Permalink
reorganized js
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfiorillo committed Feb 26, 2012
1 parent 35ed3f4 commit 349980c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
16 changes: 1 addition & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,10 @@
<link rel="stylesheet" href="css/fancyselect.css" type="text/css" />

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/fancyselect.js"></script>
<script type="text/javascript">
$(document).ready(function() {

$.fn.fancyselect = function() {
this.each(function(i,select){
$(select).wrap('<span class="fancyselect" />');
$(select).before('<span class="arrows" />');
$(select).focus(function(){
$(this).parent('span').addClass('focus');
});
$(select).blur(function(){
$(this).parent('span').removeClass('focus');
});
});
};

$("#wrapper select").fancyselect();

});
</script>

Expand Down
12 changes: 12 additions & 0 deletions js/fancyselect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$.fn.fancyselect = function() {
this.each(function(i,select){
$(select).wrap('<span class="fancyselect" />');
$(select).before('<span class="arrows" />');
$(select).focus(function(){
$(this).parent('span').addClass('focus');
});
$(select).blur(function(){
$(this).parent('span').removeClass('focus');
});
});
};

0 comments on commit 349980c

Please sign in to comment.