当前位置: 代码迷 >> 综合 >> Apicloud-openWin和openFrame设置透明
  详细解决方案

Apicloud-openWin和openFrame设置透明

热度:16   发布时间:2023-12-28 00:22:55.0

比如a.html页面要使用openFrame方式弹窗b.html页面,实现半透明遮挡a.html效果
第一步:在b.html顶部设置
body{
        background: transparent;
}
第二步:在a.html中openFrame参数中添加
bgColor:'rgba(255, 255, 255, 0.2)',

黑色透明度:bgColor:'rgba(0, 0, 0, 0.5)',
比如:

function openWoDe(){
      api.openFrame({
          name: 'taobao_back',
          url: '../html/frame4/taobao_back.html',
          rect: {
              x: 0,
              y: 0,
              w: 'auto',
              h: 'auto'
          },
          bounces: false,
          bgColor:'rgba(0, 0, 0, 0.5)',
      });

}