<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
a{
color:#02D;
text-decoration: none;
}
a:hover{
color:#F50;
text-decoration: underline;
}
.SubCategoryBox{
width: 600px;
margin: 0 auto;
text-align: center;
margin-top: 40px;
border: 1px solid #000;
}
.SubCategoryBox ul{
list-style: none;
}
.SubCategoryBox ul li{
display: block;
float: left;
width: 200px;
line-height: 20px;
}
.showmore{
clear:both;
text-align: center;
padding-top: 10px;
}
.showmore a{
display: block;
width: 120px;
margin: 0 auto;
line-height: 24px;
border: 1px solid #AAA;
}
.showmore a span{
padding-left: 15px;
}
.promoted a{
color:#F50;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script>
$(function(){
let $category = $("ul li:gt(5):not(:last)");
$category.hide();
let $toggleBtn = $("div.showmore>a");
$toggleBtn.click(function(){
if($category.is(":visible")){
$category.hide();
$(this).find("span").text("Show all brands")
$("ul li").removeClass("promoted");
}else{
$category.show();
$(this).find("span").text("Streamline display brand");
$("ul li").filter(":contains('Canon'),:contains('Nikon'),:contains('Olympus')").addClass("promoted");
}
return false;
})
});
</script>
</head>
<body>
<div class="SubCategoryBox">
<ul>
<li><a href="#">Canon</a></li>
<li><a href="#">Sony</a></li>
<li><a href="#">Samsung </a></li>
<li><a href="#">Nikon</a></li>
<li><a href="#">Olympus</a></li>
<li><a href="#">Panasonic</a></li>
<li><a href="#">Canon</a></li>
<li><a href="#">Sony</a></li>
<li><a href="#">Samsung </a></li>
<li><a href="#">Nikon</a></li>
<li><a href="#">Olympus</a></li>
<li><a href="#">Panasonic</a></li>
<li><a href="#">Canon</a></li>
<li><a href="#">Sony</a></li>
<li><a href="#">Samsung </a></li>
<li><a href="#">Nikon</a></li>
<li><a href="#">Olympus</a></li>
<li><a href="#">Panasonic</a></li>
</ul>
<div class="showmore">
<a href="more.html"><span>Show all brands</span></a>
</div>
</div>
</body>
</html>
Golang Tutorial
Introduction Variables Constants Data Type Convert Types Operators If..Else Switch..Case For Loops Functions Variadic Functions Deferred Functions Calls Panic and Recover Arrays Slices Maps Struct Interface Goroutines Channels Concurrency Problems Logs Files and Directories Reading and Writing Files Regular Expression Find DNS records Cryptography Gotchas in Golang Import and Export Best Golang Packages Web Application Goroutines and Channels Exercises Reflection in Golang Golang for beginners Strings in Golang HTTP Client Server Examples Context PackageGolang Reference
Basic Programs Advance Programs Data Structure and Algorithms Date and Time Slice Sort, Reverse, Search Functions String Functions Methods and Objects Interface TypeBeego Framework
Beego Setup Beego Database Migration Beego GET POST Beego RoutingMost Helpful This Week
How to import structs from another package in Go?How to check if a string contains a numbers in Golang?Sierpinski Carpet in Go Programming LanguageSierpinski triangle in Go Programming LanguageHow to concatenate two or more slices in Golang?Replace first occurrence of string using RegexpHow to kill execution of goroutine?Create and Print Multi Dimensional Slice in GolangExample to compare Println vs PrintfHow to include and execute HTML template?
Golang Programs is designed to help beginner programmers who want to learn web development technologies, or start a career in website development. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content.