mirror of
https://github.com/RobbieHan/sandboxMP.git
synced 2026-02-03 19:03:15 +08:00
19 lines
785 B
JavaScript
19 lines
785 B
JavaScript
(function($){
|
|
jQuery.fn.select = function(options){
|
|
return this.each(function(){
|
|
var $this = $(this);
|
|
var $select_option = $this.find(".selectOption");
|
|
var $select_menu = $this.find(".selectMenu");
|
|
var $select_li = $this.find("ul > li");
|
|
$this.click(function(e){
|
|
$select_menu.toggleClass("dis");
|
|
e.stopPropagation();
|
|
});
|
|
$select_li.bind("click",function(){
|
|
var $this_ = $(this);
|
|
$select_option.removeClass('op')
|
|
$select_option.text($this_.text());
|
|
});
|
|
});
|
|
}
|
|
})(jQuery);
|