自定义jQuery Mobile工具栏按钮

自定义jQuery Mobile工具栏按钮

1、实现效果

2、代码

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<style type="text/css" media="screen">

<!-- 自定义CSS:工具栏自定义带文字按钮 -->
.toolbar_btn {
    margin-left:5px;
    height:35px;
    overflow:hidden;
}
.header_btn div {
    float:left;
    height:100%;
    line-height:35px;
}
.header_btn div:last-child {
    text-decoration:none;
    font-size:14px;
    color:#FFF;
    font-family:Microsoft YaHei;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    width:80px;
}
<!-- The End -->

</style>
</head>
<body>

<div data-role="page" id="pageone">
  <div data-role="header" data-position="fixed" data-tap-toggle="false">
    <h1>Contacts</h1>
    <a href="#pageHome" class="ui-btn-left" data-transition="slidefade" data-role="none">
        <div class="header_btn">
       <!-- 使用<img> 的 width、height、padding、控制图片的大小和位置 -->
            <div><img src="images/btn_back.png" width="10" height="21" style="padding:6px"/></div>
            <div>我的信息</div>
          </div>
    </a>
  </div>

  <div data-role="content">
    <p>在此处插入正文</p>
  </div>

  <div data-role="footer" data-position="fixed" data-tap-toggle="false" data-theme="f">
    <h1>在此处插入页脚文本</h1>
  </div>
</div> 

</body>
</html>

 

 

 

posted @ 2016-07-30 06:26  Duke-码动青春  阅读(130)  评论(0编辑  收藏  举报