ich mit jquery bin zu wollen, die vorhergehenden Geschwister eines Elements zu finden, also für ein Beispieljquery finden
<li>
<a href="">
<img src="http://placehold.it/45x45" alt="Profile Image"/>
<hgroup>
<h5>Person Number 1</h5>
<h6>Recruitment Consultant</h6>
</hgroup>
</a>
</li>
<li>
<a href="">
<img src="http://placehold.it/45x45" alt="Profile Image"/>
<hgroup>
<h5>Person Number 2</h5>
<h6>Recruitment Consultant</h6>
</hgroup>
</a>
</li>
<li>
<a href="">
<img src="http://placehold.it/45x45" alt="Profile Image"/>
<hgroup>
<h5>Person Number 3</h5>
<h6>Recruitment Consultant</h6>
</hgroup>
</a>
</li>
Wenn ich a
des zweiten Listenelement schweben waren, wie würde ich die vorherige finden li
's a
?
Mein Versuch, unten ist,
$('resultsset a').hover(function(){
$(this).prev().find('li a').css('bottom-bottom', '1px solid #000');
},
function() {
$(this).prev().find('li a').css('bottom-border', '1px solid #c0c0c0');
});
Try '$ (this) .parent(). Zurück(). Finden ('a'). Css (...)' –
Ich denke, 'bottom-bottom' und' Bottom border 'soll' border-bottom' sein –