This time I will share jQuery Plugin and tutorial about Responsive Off-canvas Navigation with Gooey Transition Effect, hope it will help you in programming stack.
A jQuery & CSS / CSS3 based responsive off-canvas push navigation that comes with a cool gooey transition effect as you resize the browser window.
How to use it:
1. Include the Font Awesome 4 for navigation icons.
1 |
< link rel = "stylesheet" href = "/path/to/font-awesome.min.css" > |
2. Create an off-canvas sidebar navigation for your website.
03 |
< nav class = "site-nav" > |
04 |
< a class = "active" href = "#" >< i class = "fa fa-home" ></ i > Home</ a > |
05 |
< a href = "#" >< i class = "fa fa-gears" ></ i > Services</ a > |
06 |
< a href = "#" >< i class = "fa fa-envelope" ></ i > Contact</ a > |
07 |
< a href = "#" >< i class = "fa fa-book" ></ i > Blog</ a > |
10 |
< a href = "" >< i class = "fa fa-sign-out fa-rotate-180" ></ i > Logout</ a > |
3. Create a toggle button which allows you to open / close the sidebar navigation.
4. The core CSS styles for the sidebar navigation.
07 |
background-color : #2A3744 ; |
09 |
-moz-transition: left 0.4 s ease, width 0.5 s cubic-bezier( 0.525 , -0.35 , 0.115 , 1.335 ); |
10 |
-o-transition: left 0.4 s ease, width 0.5 s cubic-bezier( 0.525 , -0.35 , 0.115 , 1.335 ); |
11 |
-webkit-transition: left 0.4 s ease, width 0.5 s cubic-bezier( 0.525 , -0.35 , 0.115 , 1.335 ); |
12 |
transition: left 0.4 s ease, width 0.5 s cubic-bezier( 0.525 , -0.35 , 0.115 , 1.335 ); |
17 |
color : rgba( 255 , 255 , 255 , 0.7 ); |
19 |
-moz-transition: background-color 0.3 s, color 0.3 s; |
20 |
-o-transition: background-color 0.3 s, color 0.3 s; |
21 |
-webkit-transition: background-color 0.3 s, color 0.3 s; |
22 |
transition: background-color 0.3 s, color 0.3 s; |
25 |
aside a:hover { color : #fff ; } |
27 |
aside a i, aside a img { |
33 |
aside .site-nav a { margin-bottom : 3px ; } |
35 |
aside .site-nav a.active, aside .site-nav a:hover { background-color : rgba( 0 , 0 , 0 , 0.3 ); } |
37 |
aside .site-nav a.active i { color : #24FFCE ; } |
42 |
border-top : 1px solid rgba( 0 , 0 , 0 , 0.3 ); |
50 |
aside footer a { padding : 8px ; } |
5. The required CSS styles for your main content.
2 |
-moz-transition: margin- left 0.4 s ease; |
3 |
-o-transition: margin- left 0.4 s ease; |
4 |
-webkit-transition: margin- left 0.4 s ease; |
5 |
transition: margin- left 0.4 s ease; |
6. Make them responsive.
01 |
@media ( min-width : 639px ) { |
03 |
body.nav-open section { margin-left : 250px ; } |
05<
source : jqueryscript.net
|