APICloud成长记录 二 页面框架搭建调整

<span style="font-family:Microsoft YaHei;font-size:14px;"></span>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>main</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <style>
    html,
            body {
                height: 100%;
                background-color: #f0f0f0;
            }
            
            body {//盒子布局
                display: -webkit-box;
                display: -webkit-flex;
                display: flex;
                -webkit-box-orient: vertical;//纵向布局
                -webkit-flex-flow: column;
                flex-flow: column;
            }
    //头部开始
    .header-outer {
                width: 100%;
                height: auto;
            }
            
            .header-item {
                position: relative;
                display: none;
            }
            
            .header-item-act {
                display: block;
            }
            
            header>div:nth-child(1) {
                position: relative;
                background-color: rgb(255, 132, 0);
                height: 50px;
            }
            
            header>div:nth-child(2) {
                position: relative;
                height: 50px;
                background-color: rgb(252, 252, 252);
            }
            
            header>div:nth-child(3) {
                position: relative;
                height: 50px;
                background-color: rgb(252, 252, 252);
            }
            /* header home */
            
            .home-citylist {
                float: left;
                height: 50px;
                line-height: 50px;
                color: #fff;
                font-size: 14px;
                margin-left: 15px;
            }
            
            .home-citylist>img {
                height: 20px;
                vertical-align: top;
                padding-top: 15px;
            }
            
            .home-search {
                position: absolute;
                bottom: 8px;
                left: 90px;
                right: 60px;
                height: 34px;
                line-height: 34px;
                background-color: rgb(250, 102, 4);
                border-radius: 34px;
                color: rgb(253, 194, 155);
                font-size: 14px;
            }
            
            .home-search>img {
                height: 20px;
                padding-top: 7px;
                padding-left: 10px;
                padding-right: 10px;
                vertical-align: top;
            }
            
            .home-msg {
                float: right;
            }
            
            .home-msg>img {
                height: 28px;
                padding-top: 11px;
                vertical-align: top;
                padding-left: 15px;
                padding-right: 15px;
            }
            /* header groupbuy */
            
            .groupbuy-citylist {
                float: left;
                height: 50px;
                line-height: 50px;
                color: rgb(255, 132, 0);
                font-size: 18px;
                margin-left: 15px;
            }
            
            .groupbuy-citylist>img {
                height: 15px;
                vertical-align: top;
                padding-top: 18px;
            }
            
            .groupbuy-search {
                position: absolute;
                bottom: 8px;
                left: 110px;
                right: 15px;
                height: 34px;
                line-height: 34px;
                background-color: rgb(232, 232, 232);
                border-radius: 34px;
                color: rgb(153, 153, 153);
                font-size: 14px;
            }
            
            .groupbuy-search>img {
                height: 20px;
                padding-top: 7px;
                padding-left: 10px;
                padding-right: 10px;
                vertical-align: top;
            }
            /* header search */
            
            .find-search {
                position: absolute;
                bottom: 8px;
                left: 15px;
                right: 60px;
                height: 34px;
                line-height: 34px;
                border-radius: 34px;
                background-color: rgb(232, 232, 232);
                color: rgb(153, 153, 153);
                font-size: 14px;
            }
            
            .find-search>img {
                height: 20px;
                padding-top: 7px;
                padding-left: 10px;
                padding-right: 10px;
                vertical-align: top;
            }
            
            .find-scanner {
                float: right;
                width: 50px;
                background: url(./image/header/qrcode_search.png) no-repeat center 6px;
                background-size: auto 24px;
                padding-top: 33px;
                color: rgb(153, 153, 153);
                font-size: 12px;
                text-align: center;
            }
            
            .find-scanner-hov {
                background-color: #ddd;
            }
    .place-holder{/*中间给其沾满空间*/
    width:100%;
    -webkit-box-flex: 1;
    -webkit-flex:1;
    flex:1;
    background-color:#3352CC;
    }
    /*给页脚盒子布局*/
    .footer{
    display:-webkit-box;
    display:-webkit-flex;
    -webkit-box-orient : horizontal;/*横向布局*/
    -webkit-flex-flow : row;
    flex-flow : row;
    width:100%;
    height :60px;
    background-color:red;
    }
    .footer .menu{
    box-sizing:border-box;
    padding-top:42px;
    padding-bottom:5px;
    -webkit-box-flex: 1;
    -webkit-flex:1;
    flex:1;
    height:60px;
    text-align:center;
    font-size:13px;
   
    background-size:30px 30px;
    background-position:center 6px;
    background-repeat:no-repeat;
    }
   
    .footer .home{
    background-image :url(../image/footer/home.png);
    }
    .footer .home.active{
    background-image :url(../image/footer/home_act.png);
    }
    .footer .groupbuy{
    background-image :url(../image/footer/groupbuy.png);
    }
    .footer .groupbuy.active{
    background-image :url(../image/footer/groupbuy_act.png);
    }
    .footer .find{
    background-image :url(../image/footer/find.png);
    }
    .footer .find.active{
    background-image :url(../image/footer/find_act.png);
    }
    .footer .my{
    background-image :url(../image/footer/my.png);
    }
    .footer .my.active{
    background-image :url(../image/footer/my_act.png);
    }
   
    .header{
    display:-webkit-box;
    display:-webkit-flex;
    display:flex;
    -webkit-box-orient: horizontal;
    -webkit-flex-flow:row;
    flex-flow:row;
    }
    </style>
</head>
<body>
<header id="header" class="header-outer">
            <div class="header-item header-item-act" id="home">
                <div class="home-citylist open-win" win="html/citylist">
                    <span class="currentCity">武汉</span>
                    <img src="../image/header/arrow_down_home.png">
                </div>
                <div class="home-search open-win" win="html/search">
                    <img src="../image/header/search_home.png">
                    <span>输入商户名、地点</span>
                </div>
                <div class="home-msg open-win" win="html/message">
                    <img src="../image/header/msg_home.png">
                </div>
            </div>
            <div class="header-item" id="groupbuy">
                <div class="groupbuy-citylist open-win" win="html/citylist">
                    <span class="currentCity">北京</span>
                    <img src="../image/header/arrow_down_groupbuy.png">
                </div>
                <div class="groupbuy-search open-win" win="html/search">
                    <img src="../image/header/search_groupbuy.png">搜索团购...
                </div>
            </div>
            <div class="header-item" id="find">
                <div class="find-search open-win" win="html/search">
                    <img src="../image/header/search_groupbuy.png"> 输入商户名、地点
                </div>
                <div class="find-scanner" tapmode="highlight" οnclick="fnOpenScanner()">
                    扫一扫
                </div>
            </div>
            <div class="header-item" id="my">
            </div>
        </header>
<div class="place-holder"></div>
<footer id="footer" class="footer">
<div class="menu home active" tapmode οnclick="showContent(0)">首页</div>
<div class="menu groupbuy" tapmode οnclick="showContent(1)">团购</div>
<div class="menu find" tapmode οnclick="showContent(2)">发现</div>
<div class="menu my" tapmode οnclick="showContent(3)">我的</div>

</footer>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
apiready = function(){
init();
showContent(0);
};

var headers, menus,headerHeight,footerHeight;
function init(){
var header = $api.byId('header');
footer = $api.byId('footer');
headers = $api.domAll(header, '.header-item');//头部元素获取
//$api.fixIos7Bar(header);
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值