Skip to content
This repository was archived by the owner on Jul 24, 2019. It is now read-only.

Commit a859b7f

Browse files
committed
Merge branch 'RinkAttendant6-umd' into development
2 parents 122eb3c + 3eaaf94 commit a859b7f

File tree

6 files changed

+63
-18
lines changed

6 files changed

+63
-18
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11

22
.DS_Store
3+
bower_components/

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,30 @@ flexMenu is a jQuery plugin that lets you create responsive menus that automatic
55

66
[Source on GitHub](https://github.com/352Media/flexMenu)
77

8-
Author: [Ryan DeBeasi](http://www.ryandebeasi.com/)
9-
10-
Contributors: [Pete Bernardo](https://github.com/peterbernardo), [Dennis S. Hennen](https://github.com/dsh), and [Blake McLeod](https://github.com/bmcleod)
8+
Written by [Ryan DeBeasi](http://www.ryandebeasi.com/) and [our fantastic contributors](https://github.com/352Media/flexMenu/graphs/contributors).
119

1210
##Usage
1311

12+
First, download flexmenu.js from GitHub or install it with `bower install flexmenu`. Then, add a script tag that references flexMenu. For example: `<script src="flexmenu.js"></script>`.
13+
1414
Create an unordered list that contains your menu items. In CSS, use `display: inline-block;` or `float: left;` to get the `li` elements to line up horizontally.
1515

16-
Call flexMenu on an unordered list that contains your menu items.
16+
Finally, call flexMenu on an unordered list that contains your menu items:
1717

1818
```javascript
1919
$('ul.menu.flex').flexMenu();
2020
```
2121

22+
###AMD/RequireJS
23+
24+
The plugin can be loaded using an AMD loader such as RequireJS:
25+
26+
```javascript
27+
require(['jquery', 'flexmenu'], function ($) {
28+
$('ul.menu.flex').flexMenu();
29+
});
30+
```
31+
2232
##Dependencies
2333

2434
###jQuery
@@ -75,7 +85,7 @@ Should we absolutely position the popup? Usually this is a good idea. That way,
7585

7686
flexMenu is licensesed under the MIT License, and is free for commercial or personal use.
7787

78-
Copyright &copy; 2012 352 Media Group
88+
Copyright &copy; 2012-2014 352 Inc. & Contributors
7989

8090
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8191

bower.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "flexMenu",
3+
"version": "1.1.1",
4+
"homepage": "https://github.com/352Media/flexMenu",
5+
"authors": [
6+
"Ryan DeBeasi <[email protected]>"
7+
],
8+
"description": "FlexMenu lets you create menu bars that automatically collapse into a drop-down to fit the space available.",
9+
"main": "flexmenu.js",
10+
"keywords": [
11+
"menu",
12+
"responsive",
13+
"design"
14+
],
15+
"license": "MIT",
16+
"ignore": [
17+
"**/.*",
18+
"node_modules",
19+
"bower_components",
20+
"test",
21+
"tests"
22+
],
23+
"dependencies": {
24+
"jquery": ">1.7.0"
25+
}
26+
}

demo-subnav.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<meta name="viewport" content="width=device-width">
1111
<link rel="stylesheet" href="demo.css">
1212
<style>
13-
/* Sub-menu styles
13+
/* Sub-menu styles
1414
** Not included here: CSS for when the sub-menu appears in .menu-flex. */
1515
.menu-sub {
1616
display: none;
@@ -24,15 +24,15 @@
2424
}
2525
</style>
2626
<script src="modernizr.custom.js"></script>
27-
<link href='http://fonts.googleapis.com/css?family=Quantico:700' rel='stylesheet' type='text/css'>
27+
<link href='https://fonts.googleapis.com/css?family=Quantico:700' rel='stylesheet' type='text/css'>
2828
</head>
2929
<body>
3030

3131
<div class="header">
3232
<h1>flexMenu</h1>
3333
<p>flexMenu is a jQuery plugin that lets you create responsive menu bars. When there's only space to display some of the items in the menu, the rest of the items collapse into a "more" drop-down. When there's only space to display one or two items, all the items collapse into a "menu" drop-down. Try it out - just resize the page, or view it on a smartphone!</p>
3434
</div>
35-
35+
3636
<div role="main" class="main">
3737

3838
<ul class="menu flex">
@@ -111,16 +111,16 @@ <h2>Multiple Menus</h2>
111111
</p>
112112
</div>
113113

114-
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
114+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
115115

116116
<script src="flexmenu.min.js"></script>
117117

118-
<script type="text/javascript">
118+
<script>
119119
$('ul.menu.flex').flexMenu();
120120
$('ul.menu.flex-multi').flexMenu({
121121
showOnHover: false
122122
})
123123
</script>
124124

125125
</body>
126-
</html>
126+
</html>

demo.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
<link rel="stylesheet" href="demo.css">
1212

1313
<script src="modernizr.custom.js"></script>
14-
<link href='http://fonts.googleapis.com/css?family=Quantico:700' rel='stylesheet' type='text/css'>
14+
<link href='https://fonts.googleapis.com/css?family=Quantico:700' rel='stylesheet' type='text/css'>
1515
</head>
1616
<body>
1717

1818
<div class="header">
1919
<h1>flexMenu</h1>
2020
<p>flexMenu is a jQuery plugin that lets you create responsive menu bars. When there's only space to display some of the items in the menu, the rest of the items collapse into a "more" drop-down. When there's only space to display one or two items, all the items collapse into a "menu" drop-down. Try it out - just resize the page, or view it on a smartphone!</p>
2121
</div>
22-
22+
2323
<div role="main" class="main">
2424

2525
<ul class="menu flex">
@@ -89,16 +89,16 @@ <h2>Multiple Menus</h2>
8989
</p>
9090
</div>
9191

92-
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
92+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
9393

9494
<script src="flexmenu.min.js"></script>
9595

96-
<script type="text/javascript">
96+
<script>
9797
$('ul.menu.flex').flexMenu();
9898
$('ul.menu.flex-multi').flexMenu({
9999
showOnHover: false
100100
})
101101
</script>
102102

103103
</body>
104-
</html>
104+
</html>

flexmenu.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
Description: If a list is too long for all items to fit on one line, display a popup menu instead.
44
Dependencies: jQuery, Modernizr (optional). Without Modernizr, the menu can only be shown on click (not hover). */
55

6-
(function ($) {
6+
(function (factory) {
7+
if (typeof define === 'function' && define.amd) {
8+
// AMD. Register as an anonymous module.
9+
define(['jquery'], factory);
10+
} else {
11+
// Browser globals
12+
factory(jQuery);
13+
}
14+
}(function ($) {
715
var flexObjects = [], // Array of all flexMenu objects
816
resizeTimeout;
917
// When the page is resized, adjust the flexMenus.
@@ -134,4 +142,4 @@
134142
}
135143
});
136144
};
137-
})(jQuery);
145+
}));

0 commit comments

Comments
 (0)