如何更改iframe的z-index。我的页面生成一个随机id的iframe,我能够读取iframe ID,但不知道如何更改iframe的z-index,现在设置为10000,我想将其更改为-1。这是我的iframe。
<iframe marginheight="0px" marginwidth="0px" frameborder="0" scrolling="no" id="ebBannerIFrame_24907031_5179572172928602" src="http://ds.serving-sys.com/BurstingRes//Site-2/WSFolders/3006392_201//index.html?v=_2_27_1_0" allowtransparency="true" onload="(function(e) { var event = new EBG.Events.Event(EBG.Events.EventNames.ELEMENT_LOADED);event.dispatcher = this;event.eventData = { DOMEvent: e, elementId: "ebBannerIFrame_24907031_5179572172928602", adUId:"24907031_5179572172928602" };event.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;EBG.eventMgr.dispatchEvent(event);} )(typeof arguments != "undefined" ? arguments[0] : null);" style="border: 0px; padding: 0px; margin: 0px; left: 0px; top: 0px; width: 1400px; height: 1200px; z-index: 10000; clip: rect(auto auto auto auto); position: absolute;"></iframe>
答案 0 :(得分:1)
document.getElementById('someID').style.zIndex = -1;
$('someID').css('z-index', -1);
答案 1 :(得分:0)
这应该有效:
<iframe marginheight="0px" marginwidth="0px" frameborder="0" scrolling="no" id="ebBannerIFrame_24907031_5179572172928602" src="http://ds.serving-sys.com/BurstingRes//Site-2/WSFolders/3006392_201//index.html?v=_2_27_1_0" allowtransparency="true" onload="(function(e) { var event = new EBG.Events.Event(EBG.Events.EventNames.ELEMENT_LOADED);event.dispatcher = this;event.eventData = { DOMEvent: e, elementId: "ebBannerIFrame_24907031_5179572172928602", adUId:"24907031_5179572172928602" };event.timing = EBG.Events.EventTiming.ONTIME_AND_AFTER;EBG.eventMgr.dispatchEvent(event);} )(typeof arguments != "undefined" ? arguments[0] : null);" style="border: 0px; padding: 0px; margin: 0px; left: 0px; top: 0px; width: 1400px; height: 1200px; z-index: -1; clip: rect(auto auto auto auto); position: absolute;"></iframe>