简体   繁体   中英

Iframe width issue in android

I created application using android phonegap and I have loaded aspx page in iframe.I set width 100% for iframe and design is looking fine in onload.But while changing orientation page is not fitted to the device(width for iframe in landscape mode is applied for portrait mode iframe).The design fit to the device when i click the textbox in iframe.

var iframe = document.createElement("IFRAME");
iframe.setAttribute("src", "http://www.w3schools.com"); 
iframe.setAttribute("id", "iframeset");
iframe.style.width = 100+"%";
$("#IframeDiv").append(iframe);

<div  id="IframeDiv"></div>

please guide me thanks

您需要做的是捕获屏幕方向更改事件并动态重置iframe的宽度。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM