1.依赖文件:
<script src="js/jquery.min.js"></script>
<script src="js/BootstrapMenu.min.js"></script>
BootstrapMenu.min.js下载地址:
http://download.csdn.net/detail/zhaoliangbao2778/9601577
2.例子
var _addBtpMenuEvent = function(){
var menu = new BootstrapMenu('.panel a', {
//fetchElementData获取元数据
fetchElementData:function($rowElem){
var data = $rowElem;
return data; //return的目的是给下面的onClick传递参数
},
actions: [{
name: '属性修改',
width:300,
onClick: function(obj) {
alert($(obj).attr('dataid'));
}
}]
});
};
$(function(){
_addBtpMenuEvent();
});