I have a div that toggles the visibility of the list below it. Within that main div, I have a link that opens a colorbox (jquery "lightbox" plugin) to add a new item to the list.
Of course, when I click the link, it doesn't do anything but toggle the list (like its parent). So I added the stopPropagation() to the link. It does follow the link now, but it opens in the parent window instead of in the colorbox.
How do I fix this? Thank you :)
<div class="list">
<div class="listname">
My List Name
<a href="my_link.html" class="colorbox">Add Item</a>
</div>
<div class="items">
My Items
</div>
</div>
$(".listname").toggle(
function(){
$(this).siblings(".items").slideDown(100);
return false;
},
function(){
$(this).siblings(".items").slideUp(100);
return false;
}
);
$(".listname a").click(function(e){ e.stopPropagation(); });