Create menu with CSS3 and jQuery Google Play

View: 1354    Dowload: 0   Comment: 0   Post by: hanhga  
Author: none   Category: References   Fields: Other

10 point/4 review File has been tested

If you ever visit the Google Play store, surely will impress from the site menu. If you want to impose such type menu in your web or blog, then in this article, I will share with you each step of the page-style menu Google Play with the support of CSS3 and jQuery .

Introduction

If you ever visit the Google Play store, surely will impress from the site menu. If you want to impose such type menu in your web or blog, then in this article, I will share with you each step of the page-style menu Google Play with the support of CSS3 and jQuery .

Step 1: HTML

To our menu page similar to Google Play, we will have the html standard framework as follows:

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<div class="menu">
    <ul>
      <li class="category" data-target="apps"><i class="icon-windows">i>Appsli>
      <li class="category" data-target="movies"><i class="icon-film">i>Moviesli>
      <li class="category" data-target="music"><i class="icon-headphones">i>Musicli>
      <li class="category" data-target="books"><i class="icon-book">i>Booksli>
      <li class="category" data-target="devices"><i class="icon-desktop">i>Devicesli>
    ul>
 
    
    <div id="apps" class="sub-menu">
      <ul>
        <li>My Appsli>
        <li>Shopli>
      ul>
    div>
    <div id="movies" class="sub-menu">
      <ul>
        <li>My Moviesli>
        <li>Shopli>
      ul>
    div>
    <div id="music" class="sub-menu">
      <ul>
        <li>My Musicli>
        <li>Shopli>
      ul>
    div>
    <div id="books" class="sub-menu">
      <ul>
        <li>My Booksli>
        <li>Shopli>
      ul>
    div>
    <div id="devices" class="sub-menu">
      <ul>
        <li>My Devicesli>
        <li>Shopli>
      ul>
    div>
 
    <div class="back-btn"><i class="icon-angle-left">i>div>
  div>

Step 2: Format CSS

You copy the entire paragraph below css formatting to the following menu:

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.menu {
  color: #444;
  text-align: left;
  position: relative;
  float: left;
  width: 300px;
  background-color: #bbb;
}
  .menu i {
    display: inline-block;
    width: 20px;
  }
  .menu li {
    cursor: pointer;
    position: relative;
    z-index: 1;
    padding: 0 15px;
    height: 50px;
    line-height: 50px;
    font-weight: bold;
 
    background: #dddddd; /* Old browsers */
    background: -moz-linear-gradient(top#dddddd 0%, #cccccc 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dddddd), color-stop(100%,#cccccc)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top#dddddd 0%,#cccccc 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top#dddddd 0%,#cccccc 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top#dddddd 0%,#cccccc 100%); /* IE10+ */
    background: linear-gradient(to bottom#dddddd 0%,#cccccc 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dddddd', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */
 
  }
    .menu li.current {
      z-index: 2;
    }
    .menu li.hidden {
      z-index: 0;
      opacity: 0;
      -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
          filter: alpha(opacity=0);
    }
  .menu .sub-menu {
    position: absolute;
    top: 0;
    margin-top: 55px;
    margin-left: 30px;
    display: none;
  }
    .sub-menu li {
      background: none;
      font-size: 14px;
      height: 30px;
      line-height: 30px;
    }
  .menu .back-btn {
    position: absolute;
    top: 0;
    height: 100%;
    width: 30px;
    background-color: #fff;
    cursor: pointer;
  }
    .menu .back-btn i {
      position: relative;
      display: block;
      padding-top: 25px;
      top: 50%;
      height: 20px;
      width: 30px;
      text-align: center;
      margin-top: -10px;
    }

Step 3: jQuery

Have you noticed, in the css in step 2, we have defined for 2 class is hidden and current. And in this jQuery snippet, we simply insert the appropriate class for creating menu transitions.

01
02
03
04
05
06
07
08
09
10
    $("li.category").click(function() {
        if (!$(this).hasClass("hidden")) {
             $(this).siblings().addClass("hidden");
             $(this).addClass("current");
             var index = $(this).index();
             var offset = (-1 * $(this).height()) * index;
            $(this).animate({ "top": offset  }, 400 );
            $("#" + $(this).data("target")).fadeIn( 500 );
  }
});

And here is the fact that when we click on the back button.

1
2
3
4
$(".back-btn").click(function() {
      $(".menu li").removeClass().css({ "top": "auto" });
      $(".sub-menu").hide();
 });

Now, our menu has been completed and ready for operation, but to be able to present the corresponding icon on the menu, the more you copy the code below and paste it into the right side of the card

Very simple and easy to implement must not, be sure to leave a comment if you have problems in any part of this article offline. And especially remember sharing articles to his friends, to learn together and improve web offline.

Good luck!

Create menu with CSS3 and jQuery Google Play

Create menu with CSS3 and jQuery Google Play Posted on 14-08-2015  If you ever visit the Google Play store, surely will impress from the site menu. If you want to impose such type menu in your web or blog, then in this article, I will share with you each step of the page-style menu Google Play with the support of CSS3 and jQuery . 2.5/10 1354

Comment:

To comment you must be logged in members.

Files with category

  • Instructions for installing and configuring Windows Live Mail on Windows 10 simple

    View: 2931    Download: 0   Comment: 0   Author: none  

    Instructions for installing and configuring Windows Live Mail on Windows 10 simple

    Category: References
    Fields: Other

    0.66666666666667/6 review
    Windows 10 pre-installed Mail application for managing personal email on the device. The latest version of this application but improved a lot and support other email accounts such as Gmail or Yahoo Mail but users almost no "salty" really with this...

  • Step by step instructions to create social networking buttons with CSS3

    View: 2034    Download: 0   Comment: 0   Author: none  

    Step by step instructions to create social networking buttons with CSS3

    Category: References
    Fields: Other

    0.5625/8 review
    CSS3 help web designers have the ability to create buttons (buttons) very nice, today I will share with you two tips decoration for button in your web becomes radiant beauty that no need to use photoshop.

  • You should understand the CSS Box Shadow

    View: 2158    Download: 0   Comment: 0   Author: none  

    You should understand the CSS Box Shadow

    Category: References
    Fields: Other

    1.0357142857143/14 review
    Effects his shadow was introduced in the previous article, however, in this article, I will guide more specific about shadow attributes, you try it with anything. First we try to learn css following paragraph:

  • How to do button movement with beautiful CSS3

    View: 1841    Download: 0   Comment: 0   Author: none  

    How to do button movement with beautiful CSS3

    Category: References
    Fields: Other

    0/6 review
    Previously to create motion effects button, you must draw the button in photoshop, then switched to flash to make it possible to move. But now you need not spend too much time doing it, all because of the emergence of CSS3.

  • Create a dropdown menu with CSS3 effects with beautiful transtions

    View: 2125    Download: 0   Comment: 0   Author: none  

    Create a dropdown menu with CSS3 effects with beautiful transtions

    Category: References
    Fields: Other

    0.375/12 review
    More of the dropdown menu you want to introduce to you, this will have the effect menu transitions (converted background of menu background from pale to dark). This menu works well on browsers like FF, Chrome, Safary, but unfortunately did not work...

  • How to hack css for all browsers you should know

    View: 1751    Download: 0   Comment: 0   Author: none  

    How to hack css for all browsers you should know

    Category: References
    Fields: Other

    1.35/10 review
    In the process of web design, which makes it the most headaches is how to design web pages that you can run on the browser. Especially when clients use the old as IE6 browser such. However, with this article, you will easily edit interface runs well...

  • Create Accordion with extremely beautiful CSS3

    View: 2190    Download: 0   Comment: 0   Author: none  

    Create Accordion with extremely beautiful CSS3

    Category: References
    Fields: Other

    0.64285714285714/7 review
    Accordion is a technique that helps you shortened the content that you want displayed on the website. It is often used for the display of submenus. In addition you can also use it for content, images. Before applying this procedure, you have to use...

  • Create the effect Hovercho images with Webkit and CSS3 is great

    View: 1872    Download: 0   Comment: 0   Author: none  

    Create the effect Hovercho images with Webkit and CSS3 is great

    Category: References
    Fields: Other

    0.75/6 review
    WebKit is one open source application framework provides the necessary components built one for your web browser. Along with CSS3, cả have contributed to very nice effect những previously only using JavaScript or JQuery thực beige.​

 

File suggestion for you

File top downloads

logo codetitle
Codetitle.com - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.com Develope by Vinagon .Ltd