layer mobile開發layer.full


Layer For Mobile 之 layer.full()

背景介紹:layer mobile是專門針對手機頁面開發的一套框架,具體介紹請看官方文檔 http://layer.layui.com/mobile/api.html ,因其擴展方法有限,我用到了layer Pc版的layer.full這里做了擴展。

問題:目前layer mobile是2.0版,沒有layer.full方法。因為用到做了擴展。

包括兩部分,一部分是js,一部分是樣式。

js部分

function LayerFull(title, url) {
   
    layer.open({
        type: 1,
        btn: ["點擊關閉本頁面"],
        yes: function (index) {
            layer.close(index);
        },
        title: title,
        content: "<iframe src=" + url + "  width='100%' height='96%'></iframe>",
        style: 'position:fixed; left:0; top:0; width:100%; height:96%;    border: none;'
    });
 
};

css部分

.layui-m-layercont {
    height: 80%;
}
    .layui-m-layercont iframe {
        border: none;
        z-index: 900;
    }
.layui-m-layermain .layui-m-layerchild h3 {
    height: 30px;
    line-height: 30px;
}

/**
iOS兼容iFrame滾動條樣式
 */
.layui-m-layercont {
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    /*height: 330px;*/
}

    .layui-m-layercont iframe {
        width: 100%;
        /*height: 80%;*/
    }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM