Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (39 sloc) 1.889 kB
<?xml version="1.0"?>
<entry type="selector" name="visible" return="">
<title>:visible Selector</title>
<desc>Selects all elements that are visible.</desc>
<p>Elements are considered visible if they consume space in the document. Visible elements have a width or height that is greater than zero.</p>
<p>Elements with <code>visibility: hidden</code> or <code>opacity: 0</code> are considered visible, since they still consume space in the layout. During animations that hide an element, the element is considered to be visible until the end of the animation. During animations to show an element, the element is considered to be visible at the start at the animation.</p>
<p>How <code>:visible</code> is calculated was changed in jQuery 1.3.2. The <a href="">release notes</a> outline the changes in more detail.</p>
<note id="jquery-selector-extension" type="additional" data-selector=":visible"/>
<desc>Make all visible divs turn yellow on click.</desc>
$("div:visible").click(function () {
$(this).css("background", "yellow");
$("button").click(function () {
div { width:50px; height:40px; margin:5px; border:3px outset green; float:left; }
.starthidden { display:none; }
<html><![CDATA[<button>Show hidden to see they don't change</button>
<div class="starthidden"></div>
<div style="display:none;"></div>]]></html>
<category slug="selectors/jquery-selector-extensions"/>
<category slug="version/1.0"/>
<category slug="selectors/visibility-filter-selectors"/>
Jump to Line
Something went wrong with that request. Please try again.