ホームページ  >  記事  >  ウェブフロントエンド  >  Xiaoqiang の HTML5 モバイル開発への道 (44) – JqueryMobile のボタン

Xiaoqiang の HTML5 モバイル開発への道 (44) – JqueryMobile のボタン

黄舟
黄舟オリジナル
2017-02-15 13:21:241161ブラウズ

1. リンクボタン


2. フォームボタン

3. グラフィックボタン

4. アイコン付きボタン


5. ボタンの位置


<!DOCTYPE html> 
<html>
<head>
<meta charset="utf-8">
<title>jQuery Mobile Web 应用程序</title>
<link href="jquery-mobile/jquery.mobile-1.0.min.css" rel="stylesheet" type="text/css"/>
<script src="jquery-mobile/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="jquery-mobile/jquery.mobile-1.0.min.js" type="text/javascript"></script>
</head> 
<body>
<p data-role="page" id="page1" data-fullscreen="true">
    <p data-role="content">
    	<a href="#" data-role="button">链接按钮</a>
    </p>
</p>
</body>
</html>

6. カスタムアイコンボタン


<p data-role="page" id="page1" data-fullscreen="true">
    <p data-role="content">
    	<a href="#" data-role="button">链接按钮</a>
        <form>
        	<input type="button" value="表单按钮"/>
            <button type="submit">提交按钮</button>
            <input type="submit" value="提交按钮"/>
            <input type="reset" value="重置按钮"/>
        </form>
    </p>
</p>
rree

注: 属性の命名規則「.ui-icon-0980cfa4f0b94ba7062bda91814d9abd」そのような上記のように .ui-icon-custom_icon

7. グループボタン

            图像按钮1:
            <input type="image" src="jquery-mobile/images/icon.png" data-role="none"/>
            图像按钮2:
            <a href="#"><img src="jquery-mobile/images/icon.png"></a>



8. テーマボタン


            <input type="button" value="带图标的按钮" data-icon="delete"/>
   	    <input type="button"  data-icon="delete" data-iconpos="notext"/>
   	    <input type="button"  data-icon="alert" data-iconpos="notext"/>
            <input type="button"  data-icon="arrow-d" data-iconpos="notext"/>
            <input type="button"  data-icon="arrow-l" data-iconpos="notext"/>
            <input type="button"  data-icon="arrow-r" data-iconpos="notext"/>
            <input type="button"  data-icon="arrow-u" data-iconpos="notext"/>
            <input type="button"  data-icon="back" data-iconpos="notext"/>
            <input type="button"  data-icon="check" data-iconpos="notext"/>
            <input type="button"  data-icon="custom" data-iconpos="notext"/>
            <input type="button"  data-icon="forward" data-iconpos="notext"/>
            <input type="button"  data-icon="gear" data-iconpos="notext"/>
            <input type="button"  data-icon="grid" data-iconpos="notext"/>
            <input type="button"  data-icon="home" data-iconpos="notext"/>
            <input type="button"  data-icon="info" data-iconpos="notext"/>
            <input type="button"  data-icon="minus" data-iconpos="notext"/>
            <input type="button"  data-icon="plus" data-iconpos="notext"/>
            <input type="button"  data-icon="refresh" data-iconpos="notext"/>
            <input type="button"  data-icon="search" data-iconpos="notext"/>
            <input type="button"  data-icon="star" data-iconpos="notext"/>

9. ダイナミックボタン


            <a href="#" data-role="button" data-icon="arrow-u" data-iconpos="top">top</a>
            <a href="#" data-role="button" data-icon="arrow-l" data-iconpos="left">left</a>
            <a href="#" data-role="button" data-icon="arrow-r" data-iconpos="right">right</a>
            <a href="#" data-role="button" data-icon="arrow-d" data-iconpos="bottom">bottom</a>

そこにいるこれも json メソッドです


<a href="#" data-role="button" data-icon="custom_icon">自定义图标</a>

上記のメソッドは両方とも button() プラグインを使用します。ボタン プラグインには次のオプションがあります:

corners

boolean


icon

string

iconpos string

iconshadow boolean

initSelector css selector string

inline boolean

shadow boolean

button プラグインには次の 2 つのメソッドがあります。 $("#ボタン1") .button(" enable") ;

$("#button2").button("disable");

コード全体は次のとおりです:

.ui-icon-custom_icon{
	background:url(jquery-mobile/images/icon.png) 50% 50% no-repeat;
	background-size:14px 14px;
}

上記は Xiaoqiang の HTML5 モバイル開発パスです(44) - JqueryMobile のボタン 関連コンテンツの詳細については、PHP 中国語 Web サイト (www.php.cn) にご注意ください

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。