[jQuery] siblings() not working as expected
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="address"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="Street"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="country-region"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 89.85pt 72.0pt 89.85pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:1681858895;
mso-list-type:hybrid;
mso-list-template-ids:-501718956 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:18.0pt;
mso-level-number-position:left;
margin-left:18.0pt;
text-indent:-18.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hi John & other jQuery developers,<o:p></o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>First of all, a great big thank you for creating jQuery. It makes
creating modern, dynamic web pages a breeze!<o:p></o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>No more struggling manually navigating the DOM tree is a big
win for me.<o:p></o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I just have a few queries/notes:<o:p></o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font>
<p class=MsoNormal style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'><span
style='mso-list:Ignore'>1.<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'> </span></font></span></span></font><![endif]><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>In the API
documentation example of siblings(expr), the result is every matching sibling *excluding*
the element that was matched.
This does not appear to be the case when using this function:
My example:
$("#test").parent().siblings().hide();
<o:p></o:p></span></font>
<p class=MsoNormal style='margin-left:18.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>HTML:<o:p></o:p></span></font>
<p class=MsoNormal style='margin-left:18.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><div
class="inner">1</div><o:p></o:p></span></font>
<p class=MsoNormal style='margin-left:18.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><div class="inner">2<o:p></o:p></span></font>
<p class=MsoNormal style='margin-left:18.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'> <div
id="test"></div><o:p></o:p></span></font>
<p class=MsoNormal style='margin-left:18.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'></div><o:p></o:p></span></font>
<p class=MsoNormal style='margin-left:18.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><div
class="inner">3</div><o:p></o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>This will hide all the elements, where I would have expected
it to hide all the elements but the parent div.<o:p></o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Calling $(“#test”).parent().hide() performs as
expected, and hides only the parent div.<o:p></o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font>
<p class=MsoNormal style='margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'><span
style='mso-list:Ignore'>2.<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'> </span></font></span></span></font><![endif]><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>The mailing
list is great, but annoying to navigate through and find stuff. Have you
considered putting a proper forum up on the site? This would allow better categorization
and searching of everyone’s useful comments.<o:p></o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>3. Errata: The API documentation for
parents() and parents(expr) has the documentation for the ancestor functions
(What is the difference between parents & ancestors anyway?)
Cheers,<o:p></o:p></span></font>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font>
<p class=MsoNormal><font size=2 color="#0000a0" face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:#0000A0'>__________________
<strong><b><font face=Arial><span style='font-family:Arial'>Daniel Pickering</span></font></b></strong>
<em><i><font face=Arial><span style='font-family:Arial'>Software Developer</span></font></i></em><i><span
style='font-style:italic'>
<strong><b><font face=Arial><span style='font-family:Arial'>Energy Intellect</span></font></b></strong><b><span
style='font-weight:bold'>
</span></b><em><i><font face=Arial><span style='font-family:Arial'>Level 1, Ei
House</span></font></i></em>
<st1:Street w:st="on"><st1:address w:st="on"><em><i><font face=Arial><span
style='font-family:Arial'>189 Willis Street</span></font></i></em></st1:address></st1:Street>
<st1:address w:st="on"><st1:Street w:st="on"><em><i><font face=Arial><span
style='font-family:Arial'>P.O. Box</span></font></i></em></st1:Street><em><i><font
face=Arial><span style='font-family:Arial'> 9209</span></font></i></em></st1:address>
<st1:City w:st="on"><st1:place w:st="on"><em><i><font face=Arial><span
style='font-family:Arial'>Wellington</span></font></i></em></st1:place></st1:City>
<st1:country-region w:st="on"><st1:place w:st="on"><em><i><font face=Arial><span
style='font-family:Arial'>New Zealand</span></font></i></em></st1:place></st1:country-region></span></i>
</span></font><o:p></o:p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font>
</div>
<p class=MsoNormal><em><i><font size=2 color="#0000a0" face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:#0000A0'>Direct
Dial: +64
(0)4 381-5071</span></font></i></em><i><font size=2 color="#0000a0" face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:#0000A0;font-style:italic'>
<em><i><font face=Arial><span style='font-family:Arial'>General
Number: +64 (0)4 801-4700</span></font></i></em>
<em><i><font face=Arial><span style='font-family:Arial'>Fax:
+64 (0)4 801-4709</span></font></i></em>
<em><i><font face=Arial><span style='font-family:Arial'>Email:
</span></font></i></em></span></font></i><a
href="mailto:daniel.pickering@energyintellect.com"><em><i><font size=2
color="#0000a0" face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:#0000A0;text-decoration:none'>daniel.pickering@energyintellect.com</span></font></i></em></a>
<em><i><font size=2 color="#0000a0" face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:#0000A0'>Web:
</span></font></i></em><a href="http://www.energyintellect.com"><em><i><font
size=2 color="#0000a0" face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:#0000A0;text-decoration:none'>www.energyintellect.com</span></font></i></em></a><o:p></o:p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font>
</div>
</body>
</html>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/