Solution for page deformation caused by position in IE6 (js Code)

Source: Internet
Author: User

:


Solution:
1. When scaling the form, the blank width on the left of the content is obtained first.
$ ("# Nav"). offset (). left.
2. Get the width of the entire form (Note: The desktop resolution is the benchmark and is missing ).
3. Use the width of the desktop resolution-the width of the page content area/2 to obtain the Extra width of one side.
4. If the obtained value is different from $ ("# nav"). offset (). left;, the two values can be adjusted to the same value.
Copy codeThe Code is as follows:
Var ietest = function ()
{
If ($. browser. msie ){
If ($. browser. version = "6.0 ")
{
Var _width1_document.doc umentElement. clientWidth + 29; // desktop resolution size
$ ("# Nav" ).css ("left", (_ width-950)/2)-15); // reset the value
Return false;
}
Return false;
}
Return false;
}
Window. onresize = ietest; // event triggered when the form is scaled

Related Article

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.