zoukankan      html  css  js  c++  java
  • LinkButton(按钮)

    使用$.fn.linkbutton.defaults重写默认值对象。

    按钮组件使用超链接按钮创建。它使用一个普通的<a>标签进行展示。它可以同时显示一个图标和文本,或只有图标或文字。按钮的宽度可以动态和折叠/展开以适应它的文本标签。

     

    使用案例

    创建按钮

    使用标签创建按钮更加简单。

     
    1. <a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>  

    也可以使用Javascript创建按钮。

     
    1. <a id="btn" href="#">easyui</a>   
    2. $('#btn').linkbutton({   
    3.     iconCls: 'icon-search'  
    4. });  
    处理按钮的点击

    点击按钮会将用户引导到其他页面。

     
    1. <a href="otherpage.php" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>  

    下面的示例提示了一个警告信息。

     
    1. <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'"  
    2.         onclick="javascript:alert('easyui')">easyui</a>  

    Bind click handler using jQuery.

     
    1. <a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a>  
     
    1. $(function(){   
    2.     $('#btn').bind('click'function(){   
    3.         alert('easyui');   
    4.     });   
    5. });  

     

    属性

    属性名属性值类型描述默认值
    id string 组件的ID属性。 null
    disabled boolean 为true时禁用按钮。 false
    plain boolean 为true时显示简洁效果。 false
    text string 按钮文字。 ''
    iconCls string 显示在按钮文字左侧的图标(16x16)的CSS类ID。 null
    iconAlign string 按钮图标位置。可用值有:'left','right'。(该属性自1.3.2版开始可用) left

     

    方法

    方法名方法参数描述
    options none 返回属性对象。
    disable none 禁用按钮。 

    代码示例:

    $('#btn').linkbutton('disable');
    
    enable none 启用按钮。 

    代码示例:

    $('#btn').linkbutton('enable');
    
  • 相关阅读:
    微信小程序配置域名的时候提示“校验文件验证失败”
    微信小程序封装mixins方法
    nuxt中报window is not defined
    nuxt中iview按需加载配置
    nuxt 项目安装及环境配置
    使用指针遍历图像
    图像添加噪声(椒盐噪声)
    Java中基本知识梳理【定时器实现多线程】-----2015年3月15日
    Java基础知识---【静态成员,封装性,包】------2015年3月6日
    Java中基本知识梳理【基本变量的处理】-----2015年3月6日
  • 原文地址:https://www.cnblogs.com/dotnetmvc/p/3635461.html
Copyright © 2011-2022 走看看