版本:4.0.0
/* * 弹出式提示框,支持select变换 * options = { data:[{name,value,disabled,selected,click},], css:弹出框的css, spanstyle:'', //仅select对象时有效 spanclass:'', //仅select对象时有效, hover:false, //true为鼠标划过弹出,false为点击弹出, click:'', // 全局点击事件,会带回value参数, arrowcenteratobject:true, //箭头根据谁来居中,默认自己居中,true为根据selector的对象 } */ K.select2hintbox(selector, options)
用法举例:
// select对象直接使用即可 K.select2hintbox('select'); // 其他对象,例如用户头像栏的下拉菜单实现 K.select2hintbox('#nav_userbar', { [{ name:"我的资料", value:"my", click:function(){ location.href="/"; } },{ name:"退出登录", value:"logout", click:function(){ // do something } }], hover: true });