linkbutton(按鈕)

按鈕組件使用超鏈接按鈕創(chuàng)建。它使用一個(gè)普通的<a>標(biāo)簽進(jìn)行展示。它可以同時(shí)顯示一個(gè)圖標(biāo)和文本,或只有圖標(biāo)或文字。按鈕的寬度可以動(dòng)態(tài)和折疊/展開(kāi)以適應(yīng)它的文本標(biāo)簽。

屬性

屬性名 類(lèi)型 含義 默認(rèn)值
id string 組件ID屬性 null
dsiabled boolean 為true禁用按鈕 false
toggle boolean 為true時(shí)允許用戶切換其狀態(tài)是被選中還是未選擇,可實(shí)現(xiàn)checkbox復(fù)選效果。 false
selected boolean 定義按鈕初始的選擇狀態(tài),true為被選中,false為未選中 false
group string 指定相同組名稱的按鈕同屬于一個(gè)組,可實(shí)現(xiàn)radio單選效果 null
plain boolean 為true時(shí)顯示簡(jiǎn)潔效果。 false
text string 按鈕文字 ''
iconCls string 按鈕文字左側(cè)的圖標(biāo) null
iconAlign string 按鈕圖標(biāo)位置'left','right','top','bottom' left
size string 按鈕大小 small/large small

事件

事件名 參數(shù) 含義
onClick none 點(diǎn)擊按鈕時(shí)觸發(fā)

方法

方法名 參數(shù) 描述
options none 返回屬性對(duì)象
resize param 重置按鈕$('#btn').linkbutton('resize', {width: '100%', height: 32});
disable none 禁用按鈕
enable none 啟用按鈕
select none 選擇按鈕
unselect none 取消選擇按鈕

我的demo

圖片如下

image
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>linkbutton- jQuery EasyUI Demo</title>
  <link rel="stylesheet" type="text/css" >
  <link rel="stylesheet" type="text/css" >
  <link rel="stylesheet" type="text/css" >
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.min.js"></script>
  <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
  <script type="text/javascript">
  $(function(){
    $('#btn').linkbutton({
        iconCls: 'icon-search'
    });
    $('#btn1').linkbutton({
        id: 1,
        selected: true,
        plain:true,
        group: "性別",//group名字一樣,可實(shí)現(xiàn)radio單選效果
        text: "男",
        iconCls: 'icon-add',
        toggle:true
    });
    $('#btn2').linkbutton({
        id: 2,
        group: "性別",
        text: "女",
        toggle : true,
        iconCls: 'icon-cut'

    });
    $('#btn3').linkbutton({
        id: 3,
        selected: true,
        text: "www",
        iconCls: 'icon-edit'
    });
    $('#btn4').linkbutton({
        size: 'large',
        iconAlign: 'right',
        iconCls: 'icon-save'
    });
  })

  </script>
</head>
<body>
  <div style="margin-top:20px; margin-bottom:10px;">正常</div>
  <a id="btn" href="#">easyui</a>
  <div style="margin-top:20px; margin-bottom:10px;">radio單選效果</div>
  <a id="btn1" href="#">easyui1</a>
  <a id="btn2" href="#">easyui2</a>
  <div style="margin-top:20px; margin-bottom:10px;">選中效果</div>
  <a id="btn3" href="#">easyui3</a>
  <div style="margin-top:20px; margin-bottom:10px;">變大,圖標(biāo)居右效果</div>
  <a id="btn4" href="#">easyui4</a>
</body>
</html>
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容

  • 發(fā)現(xiàn) 關(guān)注 消息 iOS 第三方庫(kù)、插件、知名博客總結(jié) 作者大灰狼的小綿羊哥哥關(guān)注 2017.06.26 09:4...
    肇東周閱讀 12,232評(píng)論 4 61
  • Android 自定義View的各種姿勢(shì)1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 173,287評(píng)論 25 708
  • 發(fā)型大概是改變形象的唯一捷徑。不像整容手術(shù)那么勞民傷財(cái),也不用整容后遺癥擔(dān)心漫山遍野都是你的姐姐妹妹。 這世上的發(fā)...
    好小孩兒玩汽球閱讀 1,035評(píng)論 3 50
  • 假期返程,已經(jīng)好久沒(méi)有經(jīng)歷一場(chǎng)“豪堵”了,上次的經(jīng)歷還是在四年之前。 天陰陰的,預(yù)報(bào)說(shuō)今天有雨,但是還沒(méi)有下,大巴...
    心里藏著一座城閱讀 164評(píng)論 0 0
  • [4-6書(shū)語(yǔ)花香]20171020 數(shù)理媽媽思維營(yíng)踐行D32 最近天天玩湊十,今天娃主動(dòng)說(shuō)媽媽我們玩湊十吧,于是開(kāi)...
    蘇夏的后花園閱讀 195評(píng)論 0 0