Skip to content

Commit 9ac7575

Browse files
committed
Version 3
- Fixes #4, #15, and #16 - NPM and Bower added
1 parent 886429d commit 9ac7575

11 files changed

Lines changed: 361 additions & 76 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
bower_components

README.md

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,73 @@
22

33
jQuery sliding menu
44

5-
A light-weight, responsive, mobile-like menu plugin
5+
A light-weight, responsive, mobile-like navigation menu plugin
66

77
### [Demo](http://alizahid.github.io/slinky)
88

9-
### Installation
9+
## Installation
1010

1111
Download the [latest version](https://github.com/alizahid/slinky/archive/gh-pages.zip). The files you need are;
1212

13-
- assets/js/jquery.slinky.js
14-
- assets/css/jquery.slinky.css
13+
- [dist/jquery.slinky.js](dist/jquery.slinky.js)
14+
- [dist/jquery.slinky.css](dist/jquery.slinky.css)
1515

16-
### Usage
16+
### Bower
1717

18-
$('.menu').slinky(options);
18+
bower install slinky
1919

20-
### Options
20+
Include these files;
21+
22+
<script src="bower_components/slinky/dist/jquery.slinky.js"></script>
23+
24+
<link rel="stylesheet" src="bower_components/slinky/dist/jquery.slinky.css">
25+
26+
### NPM
27+
28+
npm install slinky
29+
30+
Include these files;
31+
32+
<script src="node_modules/slinky/dist/jquery.slinky.js"></script>
33+
34+
<link rel="stylesheet" src="node_modules/slinky/dist/jquery.slinky.css">
35+
36+
## Usage
37+
38+
var slinky = $('.menu').slinky(options);
39+
40+
## Options
2141

2242
Option | Default value | Description
2343
------ | ------------- | -----------
24-
`label` | 'Back' | Label for the back button. Set to `true` to use the link's own label
25-
`title` | `false` | Set to `true` to show title of current menu level
44+
`label` | 'Back' | Label for the back button. Pass `true` to use the link's own label
45+
`title` | `false` | Pass `true` to show title of current menu level
2646
`speed` | `300` | Animation speed in milliseconds
27-
`resize` | `true` | Resize menu height to match content
47+
`resize` | `true` | Resize menu height to match content on navigation
48+
49+
## API
50+
51+
### .home()
52+
53+
Navigate back to the main menu
54+
55+
Option | Default value | Description
56+
------ | ------------- | -----------
57+
`animate` | `true` | Pass false to skip animation
58+
59+
### .jump()
60+
61+
Navigate to a sub menu
62+
63+
Option | Default value | Description
64+
------ | ------------- | -----------
65+
`to` | | Pass a selector for the ul element to jump to
66+
`animate` | `true` | Pass false to skip animation
67+
68+
### .destroy()
69+
70+
Remove slinky
71+
72+
## Tips
73+
74+
- Set `.active` on a `ul` element to jump there on init

assets/css/jquery.slinky.css

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@
44
overflow: hidden;
55
transform: translateZ(0);
66
transition: all 300ms ease;
7-
-webkit-transform: translateZ(0);
8-
-webkit-transition: all 300ms ease;
97
}
108

119
.slinky-menu > ul {
1210
left: 0;
1311
position: relative;
1412
transform: translateZ(0);
1513
transition: all 300ms ease;
16-
-webkit-transform: translateZ(0);
17-
-webkit-transition: all 300ms ease;
1814
}
1915

2016
.slinky-menu ul,
@@ -56,7 +52,7 @@
5652

5753
/* Default theme */
5854

59-
.slinky-menu .header {
55+
.slinky-menu {
6056
background: #AAA;
6157
}
6258

@@ -65,8 +61,11 @@
6561
padding: 1em;
6662
}
6763

64+
.slinky-menu li {
65+
line-height: 1;
66+
}
67+
6868
.slinky-menu a {
69-
background: #AAA;
7069
border: none;
7170
color: #FFF;
7271
padding: 1em;

assets/css/master.css

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Style */
1+
/* Styles */
22

33
*,
44
*:before,
@@ -10,39 +10,68 @@
1010
outline: none;
1111
padding: 0;
1212
}
13+
1314
body {
1415
background: #000;
1516
color: #000;
1617
cursor: default;
1718
font: normal 0.75em/1 'Atlas Typewriter', 'Consolas', monospace;
1819
}
20+
1921
a {
2022
color: #AAA;
2123
border-bottom: 1px solid #AAA;
2224
padding-bottom: 2px;
2325
text-decoration: none;
2426
transition: all 300ms ease;
2527
}
28+
2629
a:hover {
2730
border-bottom-color: #000;
2831
color: #000;
2932
}
33+
3034
h1 {
31-
margin: 0;
35+
font-size: 3em;
3236
}
37+
3338
h2,
3439
h3 {
3540
margin: 1em 0;
3641
}
42+
43+
h2 {
44+
font-size: 2em;
45+
}
46+
47+
h3 {
48+
font-size: 1.5em;
49+
}
50+
51+
h4 {
52+
background: #000;
53+
color: #FFF;
54+
display: inline-block;
55+
font-size: 1em;
56+
margin-top: 2em;
57+
padding: 1em;
58+
}
59+
60+
h4:first-of-type {
61+
margin-top: 0;
62+
}
63+
3764
img {
3865
border: none;
3966
max-width: 100%;
4067
vertical-align: top;
4168
}
69+
4270
p {
4371
line-height: 1.6;
4472
margin: 2em 0;
4573
}
74+
4675
pre {
4776
background: #000;
4877
color: #FFF;
@@ -51,29 +80,40 @@ pre {
5180
padding: 2em;
5281
tab-size: 4;
5382
}
83+
5484
table {
5585
font: inherit;
5686
border-collapse: collapse;
5787
border-spacing: 0;
5888
width: 100%;
5989
}
90+
6091
tbody tr:nth-child(2n+1) {
6192
background: #EEE;
6293
}
94+
6395
th,
6496
td {
6597
line-height: 1.6;
6698
padding: 1em;
6799
text-align: left;
68100
vertical-align: middle;
69101
}
102+
103+
ul li {
104+
line-height: 1.6;
105+
list-style: square;
106+
margin: 1em 0 1em 2em;
107+
}
108+
70109
header,
71110
section,
72111
footer {
73112
margin: 5em auto;
74113
max-width: 90%;
75114
width: 40em;
76115
}
116+
77117
footer {
78118
color: #FFF;
79119
margin: 0;
@@ -82,21 +122,26 @@ footer {
82122
text-align: center;
83123
width: 100%;
84124
}
125+
85126
footer img {
86127
height: 1em;
87128
}
129+
88130
footer a:hover {
89131
border-bottom-color: #FFF;
90132
color: #FFF;
91133
}
134+
92135
.wrapper {
93136
background: #FFF;
94137
overflow: hidden;
95138
}
139+
96140
.social {
97141
margin: 2em auto;
98142
overflow: hidden;
99143
}
144+
100145
.github,
101146
.tweet {
102147
float: left;
@@ -108,9 +153,11 @@ footer a:hover {
108153
h3 {
109154
margin-top: 1em;
110155
}
156+
111157
footer {
112158
line-height: 2;
113159
}
160+
114161
footer img {
115162
margin: 0.5em 0;
116163
}

0 commit comments

Comments
 (0)