$(this).parent().remove()// Links with the class "close" will close parent
returnfalse;
}
);
Using this I am successfully able to remove a li but after its being removed...The <li> below it moves in place of the deleted one and is creating a white space. How can i remove that white space
$(this).parent().remove()// Links with the class "close" will close parent
returnfalse;
}
);
Using this I am successfully able to remove a li but after its being removed...The <li> below it moves in place of the deleted one and is creating a white space. How can i remove that white space
try setting the visibility for the list-item to "hidden" instead of removing it if you prefer to have the element occupy the space.
Some thing to the effect
.css('visibility''hidden')
Here's a simple test using longhand HTML/javascript, free of any ASPX/jQuery. I frequently do this sort of extract for cross-browser testing/development of awkward stuff.
Try commenting out the line if(pp.childNodes.length === 0) { pp.style.display = 'none'; } and you will see that (at least in IE6) the UL block still has some height even after the last LI has been removed. Hence hide it when its childNodes.length === 0 .
Once it's working, you can translate the code back into jQuery if you choose.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.