/******************************* * @author mr.think * @author blog http://mrthink.net/ * @2012.02.28 * @可自由转载及使用,但请注明版权归属 *******************************/ ; (function ($) { /* * 统一select样式并实现样式高度自定义的jquery插件@mr.think(http://mrthink.net/) */ $.fn.isimulateselect = function (iset) { iset = $.extend({ selectboxcls: 'i_selectbox', //string类型,外围class名 curscls: 'i_currentselected', //string类型,默认显示class名 optioncls: 'i_selectoption', //string类型,下拉列表class名 selectedcls: 'selected', //string类型,当前选中class名 width: 196, //number类型,模拟select的宽度 height: 300, //number类型,模拟select的最大高度 zindex: 20,//层级顺序 fun:null }, iset || {}); this.hide(); return this.each(function () { var self = this; var thiscurval, thisselect, cindex = 0; //计算模拟select宽度 if (iset.width == 0) { iset.width = $(self).width(); } var html = '
' + $(self).find('option:selected').text() + '