Freely Changing Frame Size

Source: Internet
Author: User
This article describes the effects of a free-changing framework. The framework consists of the following two parts:
1. Add the following code to the main framework page:
<SCRIPT type = "text/JavaScript">
VaR columntype = ""
VaR defaultsetting = ""
Function getcurrentsetting (){
If (document. Body)
Return (document. Body. Cols )? Document. Body. Cols:
Document. Body. Rows
}
Function setframevalue (coltype, settingvalue ){
If (coltype = "rows ")
Document. Body. rows = settingvalue
Else if (coltype = "Cols ")
Document. Body. Cols = settingvalue
}
Function resizeframe (contractsetting ){
If (getcurrentsetting ()! = Defaultsetting)
Setframevalue (columntype, defaultsetting)
Else
Setframevalue (columntype, contractsetting)
}
Function Init (){
If (! Document. All &&! Document. getelementbyid) Return
If (document. Body! = NULL ){
Columntype = (document. Body. Cols )? "Cols": "rows"
Defaultsetting = (document. Body. Cols )? Document. Body. Cols
: Document. Body. Rows
}
Else
SetTimeout ("Init ()", 100)
}
SetTimeout ("Init ()", 100)
</SCRIPT>
2. Add the following code to the above or below framework:
<
Href = "javascript: parent. resizeframe ('5, * ')"> the upper frame size is 5 </a> <form>
<Input type = "button" onclick = "parent. resizeframe ('*, 0 ')"
Value = "the frame size is 0">
</Form>
<SCRIPT>
// Double-click the mouse. The frame is divided into three parts:
Document. ondblclick = function (){
Parent. resizeframe ('1%, 50%, 49% ')
}
</SCRIPT>
The effect is complete. Please try it now!

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.