Work Summary (12)-IFRAME full strategy and image display size control

Source: Internet
Author: User
1. IFRAME Dynamic Loading Different pages:
A. Set IFRAME to runat = "server"
B. In the backgroundCodeAdd troublenofity. attributes ["src"] = address

2.When an IFRAME dynamically loads a page, remove the border:
Marginwidth = "0" framespacing = "0" marginheight = "0" frameborder = "0" allowtransparency = "true" scrolling = "no"
Add:

 <Script language = "JavaScript" type = "text/JavaScript">
Function setparentheight (){
VaR F = parent.doc ument. getelementbyid ("ctl00_maincontent_troublenofity ");
F. Height = Document. Body. scrollheight;
}

Window. onload = setparentheight;
Window. onresize = setparentheight;

</SCRIPT>
Note: ctl00_maincontent_troublenofity is the ID of IFRAME

3. IFR Ame scrolling Entries It is the browser's scroll bar.
<Script language = "JavaScript">
Function reinitiframe (FR ){
VaR IFRAME = Document. getelementbyid (FR );
Try {
VaR bheight = iframe.content20.doc ument. Body. scrollheight;
VaR dheight = iframe.content?document.doc umentelement. scrollheight;
VaR Height = math. Max (bheight, dheight );
IFRAME. Height = height;
} Catch (Ex ){}
}
</SCRIPT>
<Body bottommargin = "0" leftmargin = "0" topmargin = "0" rightmargin = "0">
<IFRAME id = "uapitsleader" runat = "server" width = "100%" Height = "100%" scrolling = "Auto" frameborder = "0" src = ".. /TM/tmtabitsleader. aspx "style =" overflow-Y: scroll "> </iframe>
<SCRIPT type = "text/JavaScript">
Window. setinterval ("reinitiframe ('upitsleader ')", 200 );
</SCRIPT>
</Body>

4. Change the style of the IFRAME scroll bar
Test.html

< IFRAME Border = 0 Name = Ye_xy Marginwidth = 0 Framespacing = 0 Marginheight = 0 SRC = "Test1.html" Frameborder = 0 Noresize width = "100%" Scrolling = Auto Height = "100%" Vspale = "0" > </ IFRAME >

Test1.html

< Html >
< Head >
< Style Type = Text/CSS >
Body {} {
SCROLLBAR-FACE-COLOR : # E8e7e7 ;  
SCROLLBAR-HIGHLIGHT-COLOR : # Ffffff ;  
SCROLLBAR-SHADOW-COLOR : # Ffffff ;  
SCROLLBAR-3DLIGHT-COLOR : # Cccccc ;  
SCROLLBAR-ARROW-COLOR : # 03b7ec ;  
SCROLLBAR-TRACK-COLOR : # Efefef ;  
SCROLLBAR-DARKSHADOW-COLOR : # B2b2b2 ;  
SCROLLBAR-BASE-COLOR : #000000 ;
}
</ Style >
</ Head >
< Body >
< Table Cellspacing = 1 Cellpadding = 2 Width = "100%" Border = 0 >
< Tbody >
< Tr Bgcolor = # Ffffff >
< TD >
< P > In line with the principle of equality and mutual benefit, the addition Alliance-the website of the three daily payment SMS Alliance reached the following agreement with the user: (addition Alliance-the website of the three daily payment SMS alliance, hereinafter referred to as "addition Alliance-three departments ") < BR >
< BR >
I. Basic conditions for partners < BR >
1. Legal personal websites or large and medium-sized ICPs that comply with "China's computer information network related policies and regulations" and other laws and regulations of the People's Republic of China; < BR >
2. Be interested in the IT industry, learn about Internet and computer-related services, and have basic knowledge and skills in providing Internet services; < BR >
3. good reputation and a certain number of customer groups; 11882205 < BR >
4. Enterprises and institutions with intention to cooperate as agents. < BR >

< P > 11. Dispute resolution < BR >
All disputes related to this cooperation shall be settled by both parties through negotiation. If the negotiation fails, the dispute shall be submitted to the Arbitration Commission for arbitration, the arbitration is final and binding on both parties. </ P >
< P > < B > In the event of the above problems, we will give warnings, stop advertising, deduct and share the account, and freeze accounts to different degrees based on the actual circumstances. Otherwise, we reserve the right to pursue further legal liabilities. Please abide by our partners! </ B > Our goal is: < Font Color = # Ff0000 > Make profits together and win-win each other! </ Font > The final right to interpret this cooperation belongs to the addition Alliance-three alliances. < BR >
< BR >
The addition Alliance-three alliances welcome users to comment on or question the terms of service of the addition Alliance-three alliances. The addition Alliance-the three alliances will constantly improve these Terms of service based on the needs of website development and technical development. Please send all comments or questions related to these Terms of service to customer service QQ: 121351877. Thank you! </ P >
</ TD > </ Tr > </ Tbody > </ Table >
</ Body >
</ Html >

4. Control the image display size [for example, when an image is uploaded in the editing control, it is displayed]:
<Style type = "text/CSS" Media = "all">
IMG
{
Border: 0;
Max-width: 600px;
Width: expression (width & gt; 600? "600px": "PX ");
Overflow: auto;
}
</Style>

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.