Self-adapting with refresh

Source: Internet
Author: User

Foreword: The leadership asks me to realize the self-adaptation, the front-end frame construction also did not have me, at the beginning project also did not consider this, because the mister said a sentence, the leadership requests realizes, alas ...

Adaptive can be implemented by flushing: Bind the Window.onresize function, calculate the height and width of a module to be refreshed, and then flush the IFRAME.

Several ways to refresh the IFRAME (online search):

Scenario One: Use the Name property of the IFRAME to locate
<input type= "button" name= "button" value= "button" onclick= "Document.frames (' Ifrmname '). Location.reload ()" >
Or
<input type= "button" name= "button" value= "button" onclick= "Document.all.ifrmname.document.location.reload ()" >

Scenario two: Locating with an IFRAME id attribute
<input type= "button" name= "button" value= "button" onclick= "Ifrmid.window.location.reload ()" >

Scenario three: When the iframe src is a different Web site address (cross-domain operation)
<input type= "button" name= "button" value= "button" onclick= "window.open (document.all.ifrmname.src, ' ifrmname ', ') ">

Scenario Four: Partial refresh via and replacement of SRC for IFRAME
You can use document.getElementById ("Iframname"). src= "" to redirect the IFrame;

Of the first three, I didn't work, and the fourth one worked.

An IFRAME has the advantage of self-adapting: The overall refresh is adaptive and there are no strange problems.

Cons: Slower than setting CSS.

Summary: The refresh Adaptive method applies to the IFrame with tables and graphs, because these adaptations usually have to redraw the table icon, and the refresh will do the work in passing.

Self-adapting with refresh

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.