当前位置: 首页 > wzjs >正文

做代练去什么网站安全合肥seo优化排名公司

做代练去什么网站安全,合肥seo优化排名公司,网站推广ww,大连网站推广爱得科技问题描述 iframe加载或者是切换iframe链接的时候,会有短暂的白屏,这个时候是在加载,目前没有想到避免的问题,应该是浏览器层面的,所以解决方法之一就是,用页面的主题背景色来遮盖一下,当他加载…

问题描述

iframe加载或者是切换iframe链接的时候,会有短暂的白屏,这个时候是在加载,目前没有想到避免的问题,应该是浏览器层面的,所以解决方法之一就是,用页面的主题背景色来遮盖一下,当他加载的时候。
这个只是众多方法中的一种

解决

<script setup>
import { ref ,watch} from 'vue'// tab 配置列表
const tabs = [{ label: '业务ss', url: 'http://localhost:5173' },{ label: '状态ss', url: 'http://localhost:5173' },{ label: 'fdfdfdf', url: 'http://localhost:5173/page15' },{ label: 'fsdfdfdfd', url: 'http://localhost:5173/page_strategy' },{ label: 'fsdf管理', url: 'http://localhost:5173' },{ label: 'fdfdfdf总览', url: 'http://localhost:5173' }
]const activeIndex = ref(0)let expanded = true;function toggleSide() {const side = document.getElementById('side');const content = document.getElementById('content');if (expanded) {side.style.width = '2vw'; // 收缩content.style.width = '97vw'} else {side.style.width = '11vw'; // 展开content.style.width = '87vw'}expanded = !expanded;
}// 点击切换按钮的时候,先遮住,再切换iframe
function switchTab(index) {let iframeDom = document.getElementsByClassName('iframe-mask')[0]iframeDom.style.opacity = 1activeIndex.value = index
}// 当iframe加载完成后,立马隐藏遮罩层,注意这里不要加动画给opacity 
function onIframeLoad() {let iframeDom = document.getElementsByClassName('iframe-mask')[0]iframeDom.style.opacity = 0
}</script><template><div><div id="title"></div><div id="middle"><div id="side" @click="toggleSide()"></div><div id="content"><!-- 顶部导航栏 --><div class="top-nav"><divv-for="(tab, index) in tabs":key="index"class="tab":class="{ active: activeIndex === index }"@click="switchTab(index)">{{ tab.label }}</div></div><!-- iframe 区域 --><div class="iframe-wrapper"><iframeclass="iframe-area":src="tabs[activeIndex].url"frameborder="0"@load="onIframeLoad"></iframe><div class="iframe-mask"></div></div></div></div><div id="bottom"></div></div>
</template><style scoped lang="less">
#title {width: 100vw;height: 5.6vh;background-image: url(../public/images/title.jpg);
}
#middle {width: 100vw;height: 89vh;display: flex;#side {width: 11vw;height: 89vh;background-image: url(../public//images/side.png);background-repeat: no-repeat;transition: width 0.3s ease; /* 添加过渡动画 */overflow: hidden;}#content {width: 87vw;height: 87vh;margin-top: 0.8vh;margin-left: 0.6vw;//background-color: aquamarine;/* 顶部导航样式 */.top-nav {height: 3vh;display: flex;//background-color: #e8f6f4;border-bottom: 3px solid #4bb3a4;//padding: 6px;}.tab {padding: 1px 16px;margin-right: 6px;border: 1px solid #48a2a3;border-bottom: none;background-color: #fff;cursor: pointer;user-select: none;border-radius: 3px 3px 0 0;&:hover {background-color: #f0fcfb;}&.active {background-color: #5ecbb8;color: #fff;font-weight: bold;}}// 用到的部分.iframe-wrapper {position: relative;width: 100%;height: 84vh;background-color: red;/* iframe 内容区域 */.iframe-area {flex: 1;width: 100%;height: 84vh;border: none;background-color: #c1eeed;}.iframe-mask {width: 100%;height: 84vh;position: absolute;inset: 0;background: #c1eeed; // 遮罩颜色,可换为 loading 图z-index: 10;pointer-events: none; // 避免遮罩拦截点击// 初始先让他是遮住的,这样当第一次加载的时候,不会出现白屏,等加载完成后,再隐藏opacity: 1;}}}}#bottom {width: 100vw;height: 5vh;background-image: url(../public/images/bottom.jpg);
}
</style>

思路

主要就是当第一次打开页面第一次加载iframe的时候,默认有个遮罩层遮住了,当加载完成的时候,遮罩层立即隐藏,当切换链接的时候,切换前先遮住,然后切换,然后加载完成的时候,遮罩层立即隐藏。


关于其他应用的一些想法

electron 还有 tauri 这些,可以在外面再封装一层c++或者rust的gui,做一个黑色空白页面,打开之后显示的是c++或者rust的gui,当监听到浏览器或者webview加载完成后,立即隐藏,切换成浏览器或者webview的页面,这样应该可以解决打开应用的那一瞬间,由于网页还没有加载造成的白屏频闪现象。

http://www.dtcms.com/wzjs/195779.html

相关文章:

  • 佛山外贸网站建设平台百度优化教程
  • 网站域名区别吗南宁一站网网络技术有限公司
  • 深圳网站建设公司报价单微信crm管理系统
  • 重庆建设工程信息网官网查询系统网址福州网seo
  • 上海的网站建设公司哪家好舆情网站直接打开
  • 黑龙江省建设厅安全员考试成都企业seo
  • 建设网站文件夹的名字网络营销模式案例
  • 怎么创建一个网站做草根站长网站优化的方法有哪些
  • 自己做网站 怎么解决安全问题软文推广经典案例
  • 本地wordpress后台进不去佛山做优化的公司
  • 洛阳网站建设lyland英文外链平台
  • 做电商网站注意什么问题怎么搭建一个网站
  • 7k网站怎么做指数基金有哪些
  • 网上学做网站网络营销的作用
  • 开封市网站开发公司近期国内热点新闻事件
  • 论坛建立网站头条发布视频成功显示404
  • 从化网站建设推广活动推广朋友圈文案
  • 网站免费虚拟空间新浪舆情通
  • 网站做的支付宝接口吗网络营销主要做什么
  • app网站建站系统策划方案企业网站推广效果指标分析
  • 建设银行官方网站诚聘英才网络营销简介
  • 长沙营销型海淀区seo搜索引擎
  • 广东网站推广域名注册时间查询
  • 优化公司怎么优化网站的小程序开发系统
  • 网站后台制作这么做信阳网站seo
  • 怎么做各个地图网站的认证发帖推广百度首页
  • 北京做网站建设的公司哪家好百度电话怎么转人工
  • 合肥网站制作前3名的旅游网站的网页设计
  • 手机网站开发方案关键词优化怎么操作
  • 企业手机网站建设渠道谷歌推广效果怎么样