Selecting siblings on hover

I have a code that goes like this on HTML:

<div class="blog_highlight">

<ul class="calendar">
<li><a href="#">Nov</a></li>
<li><a href="#">25</a></li>

<ul class="commentaries">
<li><a href="#">16</a></li>

<div class="entry_info">

<a href="#"><img src="images/blog_pix_1.jpg" width="230" height="210" alt="" /></a>


<p><a href="#" class="read_more">Leer mas</a></p>

</div><!-- end entry info -->

</div><!-- end blog highlight -->

I would like to achieve that on hover on the UL (with classes calendar and commentaries), the border color for div.entry_info and background of a.read_more changes via jQuery. This is what I have however the second one isn't working.


$('ul.calendar').hover (
function () {



function () {





My current issue is that everything except the second line works.

This is the line with the issue:


I am fairly new to jQuery and have tried siblings and next and everything but it won't work. I tried with eq(0) which worked but how do I loop it? The reason I go with classes and not ID is because this is a box that gets repeated multiple times.

Thank you for you help.


Why not simply use CSS?

ul.calendar:hover ~ .entry_info {
    // selects all .entry_info's which are on the same level (siblings) as the ul.calender  which is hovered over

BTW I'm sure that jQuery's magic $-function also supports the general sibling combinator, so $("item ~ sibling") should work just fine:

$("...").hover(function() {
    $("... ~ siblings");


Need Your Help

Vim - show diff on commit in mercurial;

vim mercurial diff hook commit

In my .hgrc I can provide an editor or a command to launch an editor with options on commit.

Convert an image to XAML?

wpf silverlight xaml expression-blend

Does anyone know of any way to convert a simple gif to xaml? E.G. A tool that would look at an image and create elipses, rectangles and paths based upon a gif / jpg / bitmap?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.