jquery Tutorial: A model of the Web-page standard

Source: Internet
Author: User
Tags object

Article Introduction: in jquery, it is possible to determine whether a standard JQuery.support.boxModel model, which returns a Boolean value, by using the property value returned by the object, and if true is the case of the model, it is not a model of a single-box.

The box model is divided into two categories, one is the model of the same, and the other is the IE box model. The fundamental difference between the two is whether the values of the attribute height and width contain padding and border. The model does not contain padding and border, only value content and height and width, while the IE box model contains padding and border.

In jquery, it is possible to determine whether a standard JQuery.support.boxModel model, which returns a Boolean value, by using the property value returned by the object, and if true is the case of the model, it is not a model of a single-box.

Here is an example of whether the test page is a model of the Web box:

<div id= "Tip" ></div>
<script>
    $ (function () {
        var Boxmodel = "The page you Open is:";
        if ($.support.boxmodel) {Boxmodel + = "The model of the" All-in-the-case)
        } else {
            Boxmodel = "ie box model"
        }
        $ ("#tip"). HTML ( Boxmodel);
    })
</script>


Related Article

Alibaba Cloud 10 Year Anniversary

With You, We are Shaping a Digital World, 2009-2019

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.