I have this javascript code:
function newsOverview() {
$(".list-news li:gt(3)").hide();
$(".box-news .btn-1").on('click', function(e){
e.preventDefault;
$(".list-news li:visible:last").nextAll(":lt(4)").fadeIn(600);
});
};
I have a big list with li items. This script is showing every time 4 li items. When you clicking on the btn-1 button. But now i have a question with this script.
- Why the e.preventDefault is not working? When i clicking the button. I scrolling back to the top of the page. Why does that is not working?
- And, Is it possible. When all items are visible. That the button disappears.