Side navigation
#13641 closed bug (invalid)
Opened March 21, 2013 01:29PM UTC
Closed April 05, 2013 09:03AM UTC
:first-child selector doesn't work (:first doesn't fit)
Reported by: | anonymous | Owned by: | anonymous |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.9.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http:www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Контакты Ohotnik.by</title>
<style type="text/css">ul{list-style-type: none;} li img{float: left; display: none;}</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<ul>
<li><a>www</a><img src="circle.png" width="10" height="10"/></li>
<li><a>www</a><img src="circle.png" width="10" height="10"/><img src="circle.png" width="10" height="10"/> <a>www</a>
<ul>
<li><a>www</a> <a>www</a>
<img src="circle.png" width="10" height="10"/>
<img src="circle.png" width="10" height="10"/>
</li>
<li><a>www</a>
<img src="circle.png" width="10" height="10"/>
<a>www</a>
<img src="circle.png" width="10" height="10"/>
<ul>
<li><a>www</a><img src="circle.png" width="10" height="10"/><img src="circle.png" width="10" height="10"/>
<a>www</a>
<img src="circle.png" width="10" height="10"/>
</li>
<li ><a>www</a><img src="circle.png" width="10" height="10"/><img src="circle.png" width="10" height="10"/>
<a>www</a>
<img src="circle.png" width="10" height="10"/>
<ul>
<li><a>www</a><img src="circle.png" width="10" height="10"/><img src="circle.png" width="10" height="10"/>
<ul>
<li><a>www</a><img src="circle.png" width="10" height="10"/><img src="circle.png" width="10" height="10"/></li>
<li class="subact"><a>www</a><img src="circle.png" width="10" height="10"/><img src="circle.png" width="10" height="10"/></li>
</ul>
</li>
<li><a>www</a><img src="circle.png" width="10" height="10"/><img src="circle.png" width="10" height="10"/></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</li>
</ul>
</body>
<script type="text/javascript">
$('.subact').children('a:first-child').css('font-weight', 'bold').css('background', 'pink');
$('.subact').parents('li').children('img').css('display', 'block'); ------------------------------ Without :first-child it works perfect. But what if i want to hide only one image?
$('.subact').parents('li').children('img:first-child').css('padding', '10px').css('background', 'aqua'); <----------------- THE BUG ---- :first-child doesn't work.
$('.subact').parents('li').children('img:first').css('padding', '10px').css('background', 'aqua'); //<-------- And! :first doesn't fit ;)
$('.subact').parents('li').children('a:first-child').css('background', 'pink');
</script>
</html>
P.S. thank you for creating and supporting jQuery! You're incredible!
Attachments (0)
Change History (2)
Changed March 21, 2013 01:50PM UTC by comment:1
owner: | → anonymous |
---|---|
status: | new → pending |
Changed April 05, 2013 09:03AM UTC by comment:2
resolution: | → invalid |
---|---|
status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
Can you put a working example on jfiddle.net? Thanks!