Mostrar solo las primeras X divisiones, alternar el resto - Trucos CSS

Anonim
var news = 2; hidenews = "- Hide news archive"; shownews = "+ Show news archive"; $(".archive").html( shownews ); $(".news:not(:lt("+news+"))").hide(); $(".archive").click(function (e) ( e.preventDefault(); if ($(".news:eq("+news+")").is(":hidden")) ( $(".news:hidden").show(); $(".archive").html( hidenews ); ) else ( $(".news:not(:lt("+news+"))").hide(); $(".archive").html( shownews ); ) ));

HTML:

 First news Second news Third news