别闹我有枪
别闹我有枪
  • 发布:2017-07-13 18:17
  • 更新:2017-07-13 18:17
  • 阅读:3497

多窗口如何让图片预览全屏预览的问题,我这样【总结】

分类:MUI

更改mui.previewimage.js文件 如下
31行增加下面代码:
作用,初始化 mui.previewImage({fWebview:['apps/home.html','apps/menu.html']});
传入需要处理的 Webview 也就是被挡住的 id

    var myFweb = this.options.fWebview||[];  
        this.fWebview = [];  
        for (var i in myFweb) {  
            var styles = plus.webview.getWebviewById(myFweb[i]).getStyle()||{};  
            this.fWebview.push({id:myFweb[i],styles:styles});  
        }  
        var myStyle = plus.webview.currentWebview().getStyle();  
        this.fWebview.push({id:myStyle.name,styles:myStyle});

300 多行 改open 函数

proto.open = function(index, group) {  
    //修改页面样式都隐藏  
    for (var i in this.fWebview) {  
            var nowStyles = {top:0,bottom:-this.fWebview[i].styles.height||0};  
            if(typeof this.fWebview[i].styles.top == 'undefined')delete nowStyles.top;  
            if(this.fWebview[i].styles.bottom >0 )nowStyles.bottom = 0;  
            plus.webview.getWebviewById(this.fWebview[i].id).setStyle(nowStyles);  
        }

320 多行 改close 函数

    proto.close = function(index, group) {  
        //还原原来的样式  
        for (var i in this.fWebview) {  
            var nowStyles = this.fWebview[i].styles;  
            var setStyles = {top:nowStyles.top,bottom:nowStyles.bottom};  
            if(typeof setStyles.top == 'undefined')delete setStyles.top;  
            plus.webview.getWebviewById(this.fWebview[i].id).setStyle(setStyles);  
        }  

搞定,参考了好多问这个问题的 总结了下。给需要的人方便

5 关注 分享
Trust 秋天无风 移动达人 8***@qq.com l丶yc

要回复文章请先登录注册

太2真人

太2真人

谢谢
2018-05-23 11:33
l丶yc

l丶yc

....实用
2018-01-30 13:39
8***@qq.com

8***@qq.com

实用
2018-01-13 09:22