Ajax Loader
×
HTML
    <ul class="menu-list">
1
    <ul class="menu-list">
2
      <li class="active"><a>Football</a></li>
3
        <ul class="second-menu">
4
          <li class="active"><a>Serie A</a></li>
5
          <li><a>Premier League</a></li>
6
          <li><a>La Liga</a></li>
7
        </ul>
8
      <li><a>Tenis</a></li>
9
        <ul class="second-menu">
10
          <li class="active"><a>Serie A</a></li>
11
          <li><a>Premier League</a></li>
12
          <li><a>La Liga</a></li>
13
        </ul>
14
      <li><a>Basketball</a></li>
15
      <li><a>Hockey</a></li>
16
    </ul>
17
 
18
 
19
 
20
<script class="cssdeck" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
 
CSS
* {
1
* {
2
  margin: 0px;
3
  padding: 0px;
4
}
5
body {
6
  width: 100%;
7
  height: 100%;
8
  background-color: #4c5830;
9
  font-family: 'Rockwell',sans-serif;
10
}
11
ul.menu-list {
12
  width: 370px;
13
  margin:50px auto;
14
  list-style: none;
15
}
16
ul.menu-list > li {
17
  cursor: pointer;
18
  width: 100%;
19
  height: 60px;
20
  border-top: 2px solid #191b13;
21
  border-bottom: 2px solid #9e9e9e;
22
  color: #b1e220;
23
  list-style: none;
24
  font-size: 1.4em;
25
  line-height: 60px;
26
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(25,27,19,1)), color-stop(100%,rgba(37,37,37,1))); /* Chrome,Safari4+ */
27
}
28
ul.menu-list > li > a {
29
  display: block;
30
  -webkit-transition:all 0.3s ease;
31
  text-decoration: none;
32
  color: #b1e220;
33
  padding-left: 55px;
34
  margin-left: 20px;
35
}
36
ul.menu-list ul.second-menu {
37
  list-style: none;
38
  width: 100%;
39
  display: none;
40
}
41
ul.menu-list > li:hover > a {
42
  padding-left: 70px;
43
}
44
ul.menu-list > li.active > a{
45
  padding-left: 70px;
46
}
47
ul.menu-list > li.active + ul.second-menu {
48
  display: block;
49
}
50
ul.menu-list > li:nth-of-type(1) a {
51
  background: url('http://s12.postimg.org/z2hfjnpbt/football_icon.png') no-repeat left center;
52
}
53
ul.menu-list > li:nth-of-type(2) a {
54
  background: url('http://s18.postimg.org/uzopds105/tenis_icon.png') no-repeat left center;
55
}
56
ul.menu-list > li:nth-of-type(3) > a {
57
  background: url('http://s16.postimg.org/b8bat4hb5/basketball_icon.png') no-repeat left center;
58
}
59
ul.menu-list > li:nth-of-type(4) > a {
60
  background: url('http://s24.postimg.org/g005z8fmp/hockey_icon.png') no-repeat left center;
61
}
62
/*SECOND MENU */
63
ul.second-menu > li {
64
  line-height: 75px;
65
  height: 75px;
66
  border-top: 2px solid #191b13;
67
  border-bottom: 2px solid #9e9e9e;
68
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(99,99,99,1)), color-stop(100%,rgba(85,85,85,1))); /* Chrome,Safari4+ */
69
}
70
ul.second-menu > li > a {
71
  text-decoration: none;
72
  display: block;
73
  -webkit-transition:all 0.3s ease;
74
  color: #e5e6e5;
75
  font-size: 1.4em;
76
  padding-left: 50px;
77
}
78
ul.second-menu > li:hover > a {
79
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(177,226,32,1)), color-stop(100%,rgba(116,141,46,1))); /* Chrome,Safari4+ */
80
  color: #252525;
81
  cursor: pointer;
82
}
 
JavaScript
    $('ul.menu-list > li').click(function(){
1
    $('ul.menu-list > li').click(function(){
2
      $('ul.menu-list > li.active').removeClass('active');
3
      $(this).addClass('active');
4
      return false;
5
    });
 

Untitled

CSSDeck G+