Skip to content

Commit dccf7b2

Browse files
danheberdenajpiano
authored andcommitted
moved selecting-elements and doc-ready into jquery-basics folder try 2
1 parent 9871d63 commit dccf7b2

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

content/jquery-fundamentals/jquery-basics/document-ready.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ Passing a named function instead of an anonymous function
3939
}
4040
</div>
4141

42-
`$(document).ready(readyFn);`
42+
`$(document).ready(readyFn);`

content/jquery-fundamentals/jquery-basics/selecting-elements.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ title : Selecting Elements
55
attribution: jQuery Fundamentals
66
---
77
## Selecting Elements
8+
Selecting Elements
9+
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
810
911
The most basic concept of jQuery is to “select some elements and do something with them.”
1012
jQuery supports most CSS3 selectors, as well as some non-standard selectors.
@@ -51,7 +53,11 @@ Pseudo-selectors
5153
When you use the :visible and :hidden pseudo-selectors, jQuery tests the actual
5254
visibility of the element, not its CSS visibility or display — that is, it looks
5355
to see if the element's physical height and width on the page are both greater than zero.
56+
<<<<<<< HEAD
5457
However, this test doesn't work with &lt;tr> elements; in this case, jQuery does check
58+
=======
59+
However, this test doesn't work with <tr> elements; in this case, jQuery does check
60+
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
5561
the CSS display property, and considers an element hidden if its display property
5662
is set to none. Elements that have not been added to the DOM will always be
5763
considered hidden, even if the CSS that would affect them would render them
@@ -66,21 +72,33 @@ For reference, here is the code jQuery uses to determine whether an element is v
6672
skip = elem.nodeName.toLowerCase() === "tr";
6773

6874
// does the element have 0 height, 0 width,
75+
<<<<<<< HEAD
6976
// and it's not a &lt;tr>?
77+
=======
78+
// and it's not a <tr>?
79+
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
7080
return width === 0 && height === 0 && !skip ?
7181

7282
// then it must be hidden
7383
true :
7484

7585
// but if it has width and height
86+
<<<<<<< HEAD
7687
// and it's not a &lt;tr>
88+
=======
89+
// and it's not a <tr>
90+
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
7791
width > 0 && height > 0 && !skip ?
7892
7993
// then it must be visible
8094
false :
8195

8296
// if we get here, the element has width
97+
<<<<<<< HEAD
8398
// and height, but it's also a &lt;tr>,
99+
=======
100+
// and height, but it's also a <tr>,
101+
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
84102
// so check its display property to
85103
// decide whether it's hidden
86104
jQuery.curCSS(elem, "display") === "none";
@@ -105,7 +123,11 @@ jQuery offers many attribute-based selectors, allowing you to make selections
105123
based on the content of arbitrary attributes using simplified regular expressions.
106124

107125
<div class="example" markdown="1">
126+
<<<<<<< HEAD
108127
// find all &lt;a>s whose rel attribute
128+
=======
129+
// find all <a>s whose rel attribute
130+
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
109131
// ends with "thinger"
110132
$("a[rel$='thinger']");
111133
</div>
@@ -180,7 +202,11 @@ Sometimes you have a selection that contains more than what you're after; in thi
180202
<div class="example" markdown="1">
181203
Refining selections
182204

205+
<<<<<<< HEAD
183206
$('div.foo').has('p'); // div.foo elements that contain &lt;p>'s
207+
=======
208+
$('div.foo').has('p'); // div.foo elements that contain <p>'s
209+
>>>>>>> moved selecting-elements and doc-ready into jquery-basics folder try 2
184210
$('h1').not('.bar'); // h1 elements that don't have a class of bar
185211
$('ul li').filter('.current'); // unordered list items with class of current
186212
$('ul li').first(); // just the first unordered list item
@@ -239,4 +265,4 @@ Selects inputs with type="text"
239265
Using form-related pseduo-selectors
240266

241267
$('#myForm :input'); // get all elements that accept input
242-
</div>
268+
</div>

0 commit comments

Comments
 (0)