The visibility selector of the jQuery selector. The jquery selector is visible.

Source: Internet
Author: User

The visibility selector of the jQuery selector. The jquery selector is visible.

<! DOCTYPE html> 
Function show (ele) {if (ele instanceof jQuery) {// if it is a jQuery element $ ("# show "). append ('element length = '+ ele. length) // display "element length = (number of ele. s)"} else {// if it is not a jQuery element alert (ele + 'not a jQuery object')} execution result: element length = 0 element length = 0 element length = 1 element length = 1 element length = 1 element length = 0 show ($ ("# div1: visible "); // the CSS display value of div1 is none. Therefore, the visible element cannot be obtained and the result is 0 show ($ (" # div2: visible ")); // The width and height of div2 are both explicitly set to 0, so the visvisible element cannot be obtained and the result is 0 show ($ ("# div3: visible ")); // div3 visibility: hidden or opacity: 0 is considered visible because they still occupy space layout. Result 1 show ($ ("# div1: hidden ")); // This element is hidden, and a hidden element is obtained. Result 1 show ($ ("# div2: hidden"); // This element is hidden, obtain a hidden element. Result 1 show ($ ("# div3: hidden"); // The element is visible and cannot be obtained. The result is 0.

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.