I am trying to use jquery droppable in a nested list, applying background color change for hovering. The problem is that it only applies to the first item in the list. However, the warning still warns the text in the list item. Any ideas why this is happening?
$("#mailbox li").droppable({
greedy: true,
hoverClass: 'mailbox-hover',
drop: function(event, ui) {
alert($(this).text());
}
});
[ Edit ] With some testing, the warning works correctly, the hover class is applied (according to FireBug), but it only changes the color of the text when you hover over the first element.
<ul id="mailbox" class="filetree">
<li>
<span class="folder">imap@gazler.com
</span>
<ul>
<li id="0-INBOX">
<span class="folder">
</span>
<a href="#" onclick="changeFolder('0', 'INBOX', 'INBOX');" name="INBOX">INBOX
</a>
<ul>
<li id="0-INBOX-Drafts">
<span class="file">
</span>
<a href="#" onclick="changeFolder('0', 'INBOX.Drafts', 'Drafts');" name="INBOX.Drafts">Drafts
</a>
<li id="0-INBOX-Sent">
<span class="file">
</span>
<a href="#" onclick="changeFolder('0', 'INBOX.Sent', 'Sent');" name="INBOX.Sent">Sent
</a>
<li id="0-INBOX-Trash">
<span class="folder">
</span>
<a href="#" onclick="changeFolder('0', 'INBOX.Trash', 'Trash');" name="INBOX.Trash">Trash
</a>
<ul>
<li id="0-INBOX-Trash-New">
<span class="file">
</span>
<a href="#" onclick="changeFolder('0', 'INBOX.Trash.New', 'New');" name="INBOX.Trash.New">New
</a>
</ul>
</ul>
</ul>
</li>
[ css are comments ]. Also, maybe a related, maybe css error, it will not let me set the background color li to hover, only the font color.
.mailbox-hover
{
background-color: #0000ff;
}
.mailbox-dropped
{
color: #ffff00;
}
[ resolved]. , , ($ (this).id), .