I have a list that I am expanding and collapsing. What I want to do is only show the +-
if the text in the li
is over a certain length.
function prepareList() {
$('.package_caption').find('ul').find('li')
.click( function(event) {
if (this == event.target) {
$(this).toggleClass('expanded');
$(this).children('ul').toggle('medium');
}
return false;
})
.addClass('collapsed')
.children('ul').hide();
};
$(document).ready( function() {
prepareList();
});