H5 前端 如何修改iframe 内置网页的样式

avatar
作者
猴君
阅读量:4

调用iframe load 的方法

<iframe id="pdf iframe" width="100%" height="600px" :src="'pdfis/web/viewer.html?file='+ pdfurl " cass="ifRame" scrolling-"yes'frameborder="o" @load="loadFrame">

loadFrame(){let pdf = document.querySelector('#pdf iframe').contentDocument

contentDocument 也可为contentWindow

个人认为主要是看是内置是html 还是文件

let body = pdf.queryselector('body')

let title = body.queryselector('.header')

title.style.display = 'none'

let content = body.querySelector('#outercontainer')
content.style.marginTop=-53px

body.style.backgroundcolor='white

body.style.backgroundImage='none

//body.style.removeProperty('background-image')console.log(pdf,body,title,content,'----0000000');

广告一刻

为您即时展示最新活动产品广告消息,让您随时掌握产品活动新动态!