Prepend and click link
Prepend and click link
I have this unordered list. It has a + sign to collapse the list. I want to still display the + yet be able to click on the link instead. How can I change this?
- (function($) {
$(document).ready(function() {
$(".wpsc_top_level_categories > li:has(li)").prepend("<span class=\"CatExpander\">+</span>");
$(".CatExpander").css( 'cursor', 'pointer' );
$(".CatExpander").toggle(function() {
$(this).html( '-' );
}, function() {
$(this).html( '+' );
});
$(".CatExpander").click(function() {
$(this).toggleClass("CatExpanded").siblings("ul").slideToggle(500);
return false;
}).eq(500).addClass("CatExpanded").end().slice(0).siblings("ul").hide();
});
})(jQuery);