Example:, the default does not show all, click the button to switch back and forth, all display is part of the recommended brand highlighting.
$(function(){//The Dom finishes loading and then executes varCategory = $ (' ul li:gt (5): Not (: last) ');//Select the li that you want to hide at the beginning, after the sixth Li, and do not include the last LiCategory.hide ();//Hidden varTOGGLEBTN = $ (' Div.showmore > A ');//Select the Click Button varToggletext = $ ('. ShowMore a span ');//Select the text element in the desired buttonTogglebtn.toggle (function() {category.show (); Toggletext.css ("Background", "#555"). Text ("Thin display"); $(' ul Li '). Filter (": Contains (' Canon '),: Contains (' Sony ')"). AddClass (' promoted ');//Select the brand you want to highlight},function() {category.hide (); Toggletext.css ("Background", "#eee"). Text ("Show All"); $(' ul Li '). Removeclass (' promoted ');//Remove Highlight class});
Sharp jquery-2--An example of showing and hiding, mainly reading the wording