1***@qq.com
1***@qq.com
  • 发布:2016-07-21 17:18
  • 更新:2016-07-22 09:44
  • 阅读:1037

选项卡 消失

分类:MUI

当容器里加入onclick失效 后来加上
$(function(){
if(!mui) return;
mui('body').on('tap','a',function () {
if($(this).attr('onclick')){
$(this).trigger('click');return;
}
if(this.href&&(this.href!="#"||this.href.indexOf('java')!=-1)){
window.location=this.href;
}
})
})
事件号令 但是 选项卡消失了

2016-07-21 17:18 负责人:无 分享
已邀请:
Trust

Trust - 少说废话

请附上可以还原场景的代码。

  • 1***@qq.com (作者)

    <!DOCTYPE html>

    <html>


    <head>

    <meta charset="utf-8">

    <title>段子</title>

    <meta name="viewport"

    content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">

    <meta name="apple-mobile-web-app-capable" content="yes">

    <meta name="viewport" content="width=375,user-scalable=no" />

    <script src="../js/httpService.js"></script>

    <script src="../js/jquery.min.js"></script>

    <script src="jokeList.js"></script>

    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="../css/style.css" type="text/css" />

    <link rel="stylesheet" href="../css/swiper-3.3.1.min.css"

    type="text/css" />

    <link rel="stylesheet" href="../css/reset.css" />

    <link rel="stylesheet" href="../css/pullToRefresh.css" />

    <link rel="stylesheet" href="../css/mui.min.css">


    <style>

    html,body {

    background-color: #ffffff;

    }


    .mui-bar ~.mui-content .mui-fullscreen {

    top: 44px;

    height: auto;

    }


    .mui-pull-top-tips {

    position: absolute;

    top: 207px;

    left: 50%;

    margin-left: -25px;

    width: 20px;

    height: 20px;

    border-radius: 100%;

    z-index: 1;

    }


    .mui-bar ~.mui-pull-top-tips {

    top: 24px;

    }


    .mui-pull-top-wrapper {

    width: 42px;

    height: 42px;

    display: block;

    text-align: center;

    background-color: #efeff4;

    border: 1px solid #ddd;

    border-radius: 25px;

    background-clip: padding-box;

    box-shadow: 0 4px 10px #bbb;

    overflow: hidden;

    }


    .mui-pull-top-tips.mui-transitioning {

    -webkit-transition-duration: 200ms;

    transition-duration: 200ms;

    }


    .mui-pull-top-tips .mui-pull-loading {

    /-webkit-backface-visibility: hidden;

    -webkit-transition-duration: 400ms;

    transition-duration: 400ms;
    /

    margin: 0;

    }


    .mui-pull-top-wrapper .mui-icon,.mui-pull-top-wrapper .mui-spinner {

    margin-top: 7px;

    }


    .mui-pull-top-wrapper .mui-icon.mui-reverse {

    /-webkit-transform: rotate(180deg) translateZ(0);/


    }


    .mui-pull-bottom-tips {

    text-align: center;

    background-color: #efeff4;

    font-size: 15px;

    line-height: 40px;

    color: #777;

    }


    .mui-pull-top-canvas {

    overflow: hidden;

    background-color: #fafafa;

    border-radius: 40px;

    box-shadow: 0 4px 10px #bbb;

    width: 40px;

    height: 40px;

    margin: 0 auto;

    }


    .mui-pull-top-canvas canvas {

    width: 40px;

    }


    .mui-slider-indicator.mui-segmented-control {

    background-color: #ffffff;

    }


    .mui-control-item {

    width: 50% !important;

    padding: 0 !important;

    }


    .mui-scroll {

    width: 100% !important;


    }


    .column {

    margin-bottom: 10px

    }


    .column {

    border-bottom: 1px solid rgba(0, 0, 0, 0.13);

    }

    </style>

    </head>


    <body>

    <header class="banner">

    <img src="" width="375" height="120" alt="" id="banner"/>

    </header>

    <div class="mui-content">

    <div id="slider" class="mui-slider mui-fullscreen"

    style="top: 120px;">

    <div id="sliderSegmentedControl"

    class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">

    <div class="mui-scroll">

    <a class="mui-control-item mui-active" style="float: left;" href="#item1mobile"> 热门

    </a> <a class="mui-control-item" href="#item2mobile"> 最新 </a>

    </div>

    </div>

    <div class="mui-slider-group" id="topmain">

    <div id="item1mobile"

    class="mui-slider-item mui-control-content mui-active">

    <div id="scroll1" class="mui-scroll-wrapper">

    <div class="mui-scroll">

    <ul class="mui-table-view" id="hotJoke">


                            </ul>  
    </div>
    </div>
    </div>
    <div id="item2mobile" class="mui-slider-item mui-control-content">
    <div class="mui-scroll-wrapper">
    <div class="mui-scroll">
    <ul class="mui-table-view" id="newJoke">

    </ul>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    <script src="../js/mui.min.js"></script>
    <script src="../js/mui.pullToRefresh.js"></script>
    <script src="../js/mui.pullToRefresh.material.js"></script>
    <script>
    mui.init();

    (function($) {
    //阻尼系数
    var deceleration = mui.os.ios?0.003:0.0009;
    $('.mui-scroll-wrapper').scroll({
    preventDefault:false,
    bounce: true,
    indicators: true, //是否显示滚动条
    deceleration:deceleration

    });
    $.ready(function() {
    //循环初始化所有下拉刷新,上拉加载。
    $.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
    $(pullRefreshEl).pullToRefresh({
    down: {
    callback: function() {
    var self = this;
    setTimeout(function() {
    var ul = self.element.querySelector('.mui-table-view');
    ul.insertBefore(createFragment(ul, index, 10, true), ul.firstChild);
    self.endPullDownToRefresh();
    }, 1000);
    }
    },
    up: {
    callback: function() {
    var self = this;
    setTimeout(function() {
    var ul = self.element.querySelector('.mui-table-view');
    ul.appendChild(createFragment(ul, index, 5));
    self.endPullUpToRefresh();
    }, 1000);
    }
    }
    });
    });
    var createFragment = function(ul, index, count, reverse) {
    var length = ul.querySelectorAll('li').length;
    var fragment = document.createDocumentFragment();
    var li;
    if(index==0){
    if(reverse){
    reflushhot();
    }
    queryJokHotList()

    }else{
    if(reverse){
    reflushnew()
    }
    queryJokNewList()
    }
    return fragment;
    };
    });
    })(mui);
    $(function(){
    if(!mui) return;
    mui('#topmain').on('tap','div',function () {
    if($(this).attr('onclick')){
    $(this).trigger('click');return;
    }
    if(this.href&&(this.href!="#"||this.href.indexOf('java')!=-1)){
    window.location=this.href;
    }
    })

    })
    function reflushhot(){
    page1=1;
    $("#hotJoke").html("");
    }
    function reflushnew(){
    page2=1;
    $("#newJoke").html("");
    }

    </script>

    </body>

    </html>

    2016-07-22 16:12

该问题目前已经被锁定, 无法添加新回复