代码:
index.html
<!DOCTYPE html> <html> <head> <title>jQuery Easy UI</title> <meta charset="UTF-8" /> <script type="text/javascript" src="easyui/jquery.min.js"></script> <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script> <script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js" ></script> <script type="text/javascript" src="js/index.js"></script> <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css" /> <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css" /> </head> <body style="margin:100px;"> <!-- <a href="###" class="easyui-linkbutton">按钮</a> --> <a id="box" href="###">按钮</a> <a id="pox" href="###">按钮</a> </body> </html> index.js
$(function () { $.fn.linkbutton.defaults.iconCls = 'icon-add'; $('#box').linkbutton({ //id : 'pox', //disabled : true, //toggle : true, //selected : true, //group : 'sex', //plain : true, text : '文字', //iconCls : 'icon-add', //iconAlign : 'right', }); $('#pox').linkbutton({ //id : 'pox', //disabled : true, //toggle : true, // group : 'sex', // iconCls : 'icon-mini-add', }); //console.log($('#box').linkbutton('options')); //$('#box').linkbutton('disable'); //$('#box').linkbutton('enable'); $('#box').linkbutton('select'); $('#box').linkbutton('unselect'); }); 截图:
