The script controls three rows and three columns adaptive height DIV Layout

Source: Internet
Author: User
Document directory
  • The script controls three rows and three columns adaptive height DIV Layout

This example uses JS scripts to control the height of the parallel DIV. In DIV layout, adaptive height is always a headache, generally, the background image, coat DIV, and right column are used to overwrite the left column ....... Now, after adding the script, it is much simpler. If there are three horizontally parallel DIV, fbox, mbox, and sbox, you only need to write the following in the <body> tag: onload = "p7_1_cols ('fbox', 'mbox', 'sbox')", test conditions: ie5.x, ie6.0, FF1.03, NS7.2, opera8.01. Final effect.

JS Code: copyright belongs to the original author and is only for study.Copy codeThe Code is as follows :/*
------------------------------------------------
PVII Equal CSS Columns scripts
Copyright (c) 2005 Project Seven Development
Www.projectseven.com
Version: 1.5.0
------------------------------------------------
*/
Function P7_colH () {// v1.5 by PVII-www.projectseven.com
Var I, oh, hh, h = 0, dA = document. p7eqc, an = document. p7eqa; if (dA & dA. length ){
For (I = 0; I <dA. length; I ++) {dA [I]. style. height = 'auto';} for (I = 0; I <dA. length; I ++ ){
Oh = dA [I]. offsetHeight; h = (oh> h )? Oh: h ;}for (I = 0; I <dA. length; I ++) {if (){
DA [I]. style. height = h + 'px ';} else {P7_eqA (dA [I]. id, dA [I]. offsetHeight, h) ;}} if (){
For (I = 0; I <dA. length; I ++) {hh = dA [I]. offsetHeight; if (hh> h ){
DA [I]. style. height = (h-(hh-h) + 'px' ;}} else {document. p7eqa = 1 ;}
Document. p7eqth = document. body. offsetHeight;
Document. p7eqtw = document. body. offsetWidth ;}
}
Function P7_eqT () {// v1.5 by PVII-www.projectseven.com
If (document. p7eqth! = Document. body. offsetHeight | document. p7eqtw! = Document. body. offsetWidth ){
P7_colH ();}
}
Function p7_1_cols () {// v1.5 by PVII-www.projectseven.com
If (document. getElementById) {document. p7eqc = new Array; for (I = 0; I <arguments. length; I ++ ){
Document. p7eqc [I] = document. getElementById (arguments [I]);} setInterval ("P7_eqT ()", 10 );}
}
Function P7_eqA (el, h, ht) {// v1.5 by PVII-www.projectseven.com
Var sp = 10, inc = 10, nh = h, g = document. getElementById (el), oh = g. offsetHeight, ch = parseInt (g. style. height );
Ch = (ch )? Ch: h; var ad = oh-ch, adT = ht-ad; nh + = inc; nh = (nh> adT )? AdT: nh; g. style. height = nh + 'px ';
Oh = g. offsetHeight; if (oh> ht) {nh = (ht-(oh-ht); g. style. height = nh + 'px ';}
If (nh <adT) {setTimeout ("P7_eqA ('" + el + "'," + nh + "," + ht + ")", sp );}
}

Xmlns = "http://www.w3.org/1999/xhtml" xml: lang = "en" lang = "en">


The script controls three rows and three columns adaptive height DIV Layout

Affinity is not just about blind people and screen readers. There are also many people who are not blind, but have visual impairment-you and I will become one of them as I grow older.
One of the simplest ways to make a website more friendly is to allow users to change the text size. rejecting such a choice will deprive users of their dominance, which may make Users unable to read it comfortably.

Affinity is not just about blind people and screen readers. There are also many people who are not blind, but have visual impairment-you and I will become one of them as I grow older.
One of the simplest ways to make a website more friendly is to allow users to change the text size. rejecting such a choice will deprive users of their dominance, which may make Users unable to read it comfortably.

Affinity is not just about blind people and screen readers. There are also many people who are not blind, but have visual impairment-you and I will become one of them as I grow older.
One of the simplest ways to make a website more friendly is to allow users to change the text size. rejecting such a choice will deprive users of their dominance, which may make Users unable to read it comfortably.

If the designer uses pixels to specify the text size, most users cannot scale the text, because Internet Explorer changes the text size in a different way than other browsers. Mozilla and Opera can scale the text that has been set to pixel size, but Windows IE cannot.

Affinity is not just about blind people and screen readers. There are also many people who are not blind, but have visual impairment-you and I will become one of them as I grow older.
One of the simplest ways to make a website more friendly is to allow users to change the text size. rejecting such a choice will deprive users of their dominance, which may make Users unable to read it comfortably.

If the designer uses pixels to specify the text size, most users cannot scale the text, because Internet Explorer changes the text size in a different way than other browsers. Mozilla and Opera can scale the text that has been set to pixel size, but Windows IE cannot.

Affinity is not just about blind people and screen readers. There are also many people who are not blind, but have visual impairment-you and I will become one of them as I grow older.
One of the simplest ways to make a website more friendly is to allow users to change the text size. rejecting such a choice will deprive users of their dominance, which may make Users unable to read it comfortably.

Back only

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.