jQuery EasyUI使用教程之创建一个链接按钮

<jQuery EasyUI最新版下载>

本教程主要为大家展示如何使用jQuery EasyUI创建一个链接按钮。通常情况下,使用“button/”元素来创建一个按钮;使用“a/”元素来创建链接按钮。所以事实上一个链接按钮是一个显示为按钮样式“a/”元素。

创建一个链接按钮

查看演示

为了创建一个链接按钮,你所需要做的就是添加一个名为'easyui-linkbutton'的类属性到“a/”元素中:

< div style = "padding:5px;background:#fafafa;width:500px;border:1px solid #ccc" >
< a href = "#" class = "easyui-linkbutton" iconcls = "icon-cancel" >Cancel</ a >
< a href = "#" class = "easyui-linkbutton" iconcls = "icon-reload" >Refresh</ a >
< a href = "#" class = "easyui-linkbutton" iconcls = "icon-search" >Query</ a >
< a href = "#" class = "easyui-linkbutton" >text button</ a >
< a href = "#" class = "easyui-linkbutton" iconcls = "icon-print" >Print</ a >
</ div >
 
< div style = "padding:5px;background:#fafafa;width:500px;border:1px solid #ccc" >
< a href = "#" class = "easyui-linkbutton" plain = "true" iconcls = "icon-cancel" >Cancel</ a >
< a href = "#" class = "easyui-linkbutton" plain = "true" iconcls = "icon-reload" >Refresh</ a >
< a href = "#" class = "easyui-linkbutton" plain = "true" iconcls = "icon-search" >Query</ a >
< a href = "#" class = "easyui-linkbutton" plain = "true" >text button</ a >
< a href = "#" class = "easyui-linkbutton" plain = "true" iconcls = "icon-print" >Print</ a >
< a href = "#" class = "easyui-linkbutton" plain = "true" iconcls = "icon-help" ></ a >
< a href = "#" class = "easyui-linkbutton" plain = "true" iconcls = "icon-save" ></ a >
< a href = "#" class = "easyui-linkbutton" plain = "true" iconcls = "icon-back" ></ a >
</ div >

正如你所看到的那样,iconCls属性是一个icon CSS类,它在按钮上显示一个icon图片。

有时你可能需要禁用或启用该链接按钮,下面的代码演示了如何禁用链接按钮:

$(selector).linkbutton('disable'); // call the 'disable' method

有兴趣的朋友可以点击查看更多有关jQuery EasyUI的文章

你可能感兴趣的:(jQuery EasyUI使用教程之创建一个链接按钮)