按鈕可以使用a或者
button
標(biāo)簽。wap
上要觸發(fā)按鈕的active
態(tài)峦睡,必須觸發(fā)ontouchstart
事件,可以在body
上加上ontouchstart=""
全局觸發(fā)拣宏。
按鈕常見的操作場景:確定鲫骗、取消犬耻、警示,分別對應(yīng)class:weui_btn_primary
执泰、weui_btn_default
枕磁、weui_btn_warn
,每種場景都有自己的置灰態(tài)weui_btn_disabled
术吝,除此外還有一種鏤空按鈕weui_btn_plain_xxx
计济,客戶端webview里的按鈕尺寸有兩類,默認(rèn)寬度100%
排苍,小型按鈕寬度自適應(yīng)沦寂,兩邊邊框與文本間距0.75em
:
<a href="javascript:;" class="weui_btn weui_btn_primary">按鈕</a>
<a href="javascript:;" class="weui_btn weui_btn_disabled weui_btn_primary">按鈕</a>
<a href="javascript:;" class="weui_btn weui_btn_warn">確認(rèn)</a>
<a href="javascript:;" class="weui_btn weui_btn_disabled weui_btn_warn">確認(rèn)</a>
<a href="javascript:;" class="weui_btn weui_btn_default">按鈕</a>
<a href="javascript:;" class="weui_btn weui_btn_disabled weui_btn_default">按鈕</a>
<div class="button_sp_area">
<a href="javascript:;" class="weui_btn weui_btn_plain_default">按鈕</a>
<a href="javascript:;" class="weui_btn weui_btn_plain_primary">按鈕</a>
<a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_primary">按鈕</a>
<a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">按鈕</a>
</div>