禁止iframe手机全屏_实现iframe 全屏显示

componentDidMount(){

var elem = document.getElementById('iframe');;

var elem = document.getElementById("iframe");

requestFullScreen(elem);

function requestFullScreen(element) {

var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;

console.log(requestMethod);

if (requestMethod) {

requestMethod.call(element);

} else if (typeof window.ActiveXObject !== "undefined") {

var wscript = new ActiveXObject("WScript.Shell");

if (wscript !== null) {

wscript.SendKeys("{F11}");

}

}

}

},

iframe设置属性  allowfullscreen="true"

var React = require('react');

import {Button} from 'antd';

var Iframe = React.createClass({

getInitialState(){

return {

src: ''

}

},

requestFullScreen:function(){

var element = document.getElementById("iframe");

var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;

console.log(requestMethod);

if (requestMethod) {

requestMethod.call(element);

} else if (typeof window.ActiveXObject !== "undefined") {

var wscript = new ActiveXObject("WScript.Shell");

if (wscript !== null) {

wscript.SendKeys("{F11}");

}

}

},

render()

{

var pathname= this.props.location.pathname;

console.log(pathname);

var src='';

if(pathname=='relationalDatabase'||pathname=="/relationalDatabase"){

src='http://10.248.26.205:8080/login.htm';

}else if(pathname=='zeppelin'||pathname=='/zeppelin'){

src='http://10.248.26.210:8080/#/';

}else if(pathname=='jupyter'||pathname=='/jupyter'){

src='http://10.248.26.207:8080/';

}else if(pathname=='rstudio'||pathname=='/rstudio'){

src='http://10.248.26.206:8080/';

}else if(pathname=='serviceInterface'||pathname=='/serviceInterface'){

src='http://10.248.26.212:8090/swagger-ui.html';

}else if(pathname=='messageMonitoring'||pathname=='/messageMonitoring'){

src='http://10.248.26.208:8083/';

}else if(pathname=='configurationManagement'||pathname=='/configurationManagement'){

src='http://10.248.26.205:3000/datasource';

} else if(pathname=='interactiveQuery'||pathname=='/interactiveQuery'){

src='http://10.248.26.204:8888/';

}else if(pathname=='componentMonitoring'||pathname=='/componentMonitoring'){

src='http://10.246.152.122:8080/';

}else if(pathname=='schedulingManagement'||pathname=='/schedulingManagement'){

src='http://10.248.26.204:11000/oozie/';

}else if(pathname=='serviceManagement'||pathname=='/serviceManagement'){

src='http://10.248.27.45:8080/dubbo-admin-2.8.4a/';

}else if(pathname=='zabbix'||pathname=='/zabbix'){

src='http://10.248.26.211/zabbix/index.php?enter=Sign in&name=Admin&password=zabbix';

}else if(pathname=='dataAcquisition'||pathname=='/dataAcquisition'){

src='http://10.248.26.204:8888/sqoop';

}

return (

src={src} >

Primary

)

}

})

;

module.exports = Iframe;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值