[Transfer] How to make the IFRAME's long width and content automatically adapt to the size

xiaoxiao2021-03-06  80

Problem Description:

Many times I may write a iframe page with only a DataGrid, this time there is a requirement: How to make the IFRAME's long width and content, such as ASP.NET, only a DataGrid list, due to the number of rows of DataGrid, The length width of IFRAME cannot be fixed.

Solution:

Use a Window.resizEther method in the ASP.NET page in IFRAME:

For example, DataGrid's ID is Grid, Write JavaScript:

Function window.onload ()

{

Var Grid = Document.GtelementByid ("

Grid ");

WINDOW.Resizeto (Grid.offSetWidth, Grid.OffsetHeight)

}

转载请注明原文地址:https://www.9cbs.com/read-107700.html

New Post(0)