Skip to content

Commit cda8ef8

Browse files
committed
Update file: jquery-menu-aim-by-kamens.html
1 parent 047fd45 commit cda8ef8

File tree

1 file changed

+101
-22
lines changed

1 file changed

+101
-22
lines changed

jquery-plugins/jquery-menu-aim-by-kamens.html

Lines changed: 101 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Jquery Plugin To Fire Events When User&#039;s Cursor Aims At Particular Dropdown Menu Items. For Making Responsive Mega Dropdowns Like Amazon&#039;s.</title>
7-
<meta name="description" content="jQuery-menu-aim by kamens. jQuery plugin to fire events when user&#039;s cursor aims at particular dropdown menu items. For making responsive mega dropdowns like Amazon&#039;s.">
6+
<title>jQuery Menu Aim by Kamens</title>
7+
<meta name="description" content="jQuery plugin to fire events when user&#039;s cursor aims at particular dropdown menu items. For making responsive mega dropdowns like Amazon&#039;s.">
88
<meta name="author" content="kamens">
99
<meta name="robots" content="index, follow">
1010
<!-- Canonical URL -->
@@ -52,7 +52,7 @@
5252
<ol class="breadcrumb mb-0">
5353
<li class="breadcrumb-item"><a href="https://codehimblog.github.io/">Home</a></li>
5454
<li class="breadcrumb-item"><a href="https://codehimblog.github.io/jquery-plugins/">jQuery Plugins</a></li>
55-
<li class="breadcrumb-item active" aria-current="page">Jquery Menu Aim</li>
55+
<li class="breadcrumb-item active" aria-current="page">jQuery Menu Aim</li>
5656
</ol>
5757
</nav>
5858
</div>
@@ -78,7 +78,7 @@
7878
{
7979
"@type": "ListItem",
8080
"position": 3,
81-
"name": "Jquery Menu Aim",
81+
"name": "jQuery Menu Aim",
8282
"item": "https://codehimblog.github.io/projects/{{packageSlug}}"
8383
}
8484
]
@@ -91,42 +91,47 @@
9191
<main class="col-md-8 site-main p-0">
9292
<article>
9393
<!-- Project Name & Description -->
94-
<h1 id="packageName">Jquery Menu Aim</h1>
94+
<h1 id="packageName">jQuery Menu Aim</h1>
9595
<p id="packageDescription" class="text-muted">jQuery plugin to fire events when user&#039;s cursor aims at particular dropdown menu items. For making responsive mega dropdowns like Amazon&#039;s.</p>
96+
97+
98+
9699
<!-- Statistics -->
97100
<div class="stat-row d-flex justify-content-around align-items-center text-center mb-2">
98-
<div class="stat-box d-flex align-items-center">
99-
<i class="bi bi-star-fill text-warning me-2"></i>
101+
<div class="stat-box d-flex align-items-center flex-column-mobile">
102+
<i class="bi bi-star-fill text-warning mb-2"></i>
100103
<div>
101104
<span id="stargazersCount" class="stat-value">7672</span>
102105
<p class="stat-label mb-0">Stars</p>
103106
</div>
104107
</div>
105-
106-
<div class="stat-box d-flex align-items-center">
107-
<i class="bi bi-box-arrow-in-down me-2"></i>
108+
109+
<div class="stat-box d-flex align-items-center flex-column-mobile">
110+
<i class="bi bi-box-arrow-in-down mb-2"></i>
108111
<div>
109112
<span id="repoSize" class="stat-value">2.59 MB</span>
110113
<p class="stat-label mb-0">Size</p>
111114
</div>
112115
</div>
113-
114-
<div class="stat-box d-flex align-items-center">
115-
<i class="bi bi-arrow-repeat text-secondary me-2"></i>
116+
117+
<div class="stat-box d-flex align-items-center flex-column-mobile">
118+
<i class="bi bi-arrow-repeat text-secondary mb-2"></i>
116119
<div>
117120
<span id="forksCount" class="stat-value">1078</span>
118121
<p class="stat-label mb-0">Forks</p>
119122
</div>
120123
</div>
121-
<div class="stat-box d-flex align-items-center">
122-
<i class="bi bi-exclamation-circle text-danger me-2"></i>
124+
125+
<div class="stat-box d-flex align-items-center flex-column-mobile">
126+
<i class="bi bi-exclamation-circle text-danger mb-2"></i>
123127
<div>
124128
<span id="openIssuesCount" class="stat-value">66</span>
125129
<p class="stat-label mb-0">Open Issues</p>
126130
</div>
127131
</div>
128132
</div>
129133

134+
130135
<div class="ad-unit ad-apt">
131136
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7089100907045419"
132137
crossorigin="anonymous"></script>
@@ -171,7 +176,77 @@ <h1 id="packageName">Jquery Menu Aim</h1>
171176
</div>
172177
<div class="tab-content mt-3" id="infoTabsContent">
173178
<div class="tab-pane fade show active" id="installation" role="tabpanel" aria-labelledby="installation-tab">
174-
No README available
179+
<h1>jQuery-menu-aim</h1>
180+
<p>menu-aim is a jQuery plugin for dropdown menus that can differentiate<br />
181+
between a user trying hover over a dropdown item vs trying to navigate into<br />
182+
a submenu's contents.</p>
183+
<p><a href="https://rawgithub.com/kamens/jQuery-menu-aim/master/example/example.html">Try a demo.</a></p>
184+
<p><img src="https://raw.github.com/kamens/jQuery-menu-aim/master/amazon.png" alt="Amazon screenshot" /></p>
185+
<p>This problem is normally solved using timeouts and delays. menu-aim tries to<br />
186+
solve this by detecting the direction of the user's mouse movement. This can<br />
187+
make for quicker transitions when navigating up and down the menu. The<br />
188+
experience is hopefully similar to amazon.com/'s &quot;Shop by Department&quot;<br />
189+
dropdown.</p>
190+
<h2>Use like so:</h2>
191+
<pre><code> $("#menu").menuAim({
192+
activate: $.noop, // fired on row activation
193+
deactivate: $.noop // fired on row deactivation
194+
});</code></pre>
195+
<p>...to receive events when a menu's row has been purposefully (de)activated.</p>
196+
<p>The following options can be passed to menuAim. All functions execute with<br />
197+
the relevant row's HTML element as the execution context ('this'):</p>
198+
<pre><code> .menuAim({
199+
// Function to call when a row is purposefully activated. Use this
200+
// to show a submenu's content for the activated row.
201+
activate: function() {},
202+
203+
// Function to call when a row is deactivated.
204+
deactivate: function() {},
205+
206+
// Function to call when mouse enters a menu row. Entering a row
207+
// does not mean the row has been activated, as the user may be
208+
// mousing over to a submenu.
209+
enter: function() {},
210+
211+
// Function to call when mouse exits a menu row.
212+
exit: function() {},
213+
214+
// Function to call when mouse exits the entire menu. If this returns
215+
// true, the current row's deactivation event and callback function
216+
// will be fired. Otherwise, if this isn't supplied or it returns
217+
// false, the currently activated row will stay activated when the
218+
// mouse leaves the menu entirely.
219+
exitMenu: function() {},
220+
221+
// Selector for identifying which elements in the menu are rows
222+
// that can trigger the above events. Defaults to "&gt; li".
223+
rowSelector: "&gt; li",
224+
225+
// You may have some menu rows that aren't submenus and therefore
226+
// shouldn't ever need to "activate." If so, filter submenu rows w/
227+
// this selector. Defaults to "*" (all elements).
228+
submenuSelector: "*",
229+
230+
// Direction the submenu opens relative to the main menu. This
231+
// controls which direction is "forgiving" as the user moves their
232+
// cursor from the main menu into the submenu. Can be one of "right",
233+
// "left", "above", or "below". Defaults to "right".
234+
submenuDirection: "right"
235+
});</code></pre>
236+
<p>menu-aim assumes that you are using a menu with submenus that expand<br />
237+
to the menu's right. It will fire events when the user's mouse enters a new<br />
238+
dropdown item <em>and</em> when that item is being intentionally hovered over.</p>
239+
<h2>Want an example to learn from?</h2>
240+
<p>Check out example/example.html -- it has <a href="https://rawgithub.com/kamens/jQuery-menu-aim/master/example/example.html">a working dropdown for you to play with</a>:</p>
241+
<p><img src="https://raw.github.com/kamens/jQuery-menu-aim/master/example.png" alt="Example screenshot" /><br><br />
242+
<em>Play with the above example full of fun monkey pictures by opening example/example.html after downloading the repo.</em></p>
243+
<h2>FAQ</h2>
244+
<ol>
245+
<li>What's the license? <a href="http://en.wikipedia.org/wiki/MIT_License">MIT</a>.</li>
246+
<li>Does it support horizontal menus or submenus that open to the left? Yup. Check out the submenuDirection option above.</li>
247+
<li>I work at a big company that requires a version number on this third party code before I can use it. Do you have a version number? Sure, current version: 1.1</li>
248+
<li>I'm not nearly bored enough. Got anything else? <a href="http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown">Read about this plugin's creation</a>.</li>
249+
</ol>
175250
</div>
176251

177252
<div class="tab-pane fade" id="changelog" role="tabpanel" aria-labelledby="changelog-tab">
@@ -181,7 +256,14 @@ <h1 id="packageName">Jquery Menu Aim</h1>
181256
</div>
182257

183258
</div>
259+
260+
<div class="tags mb-2 mt-2">
261+
262+
</div>
263+
184264
</article>
265+
266+
185267
</main>
186268
<!-- Sidebar -->
187269
<aside class="col-md-4 p-0">
@@ -238,17 +320,13 @@ <h1 id="packageName">Jquery Menu Aim</h1>
238320
</div>
239321

240322
<div class="sidebar-item mb-2">
241-
<h5 class="sidebar-title">Dependencies</h5>
242-
<ul id="dependenciesList">
243-
<li>No dependencies listed.</li>
244-
</ul>
245-
323+
<li>No dependencies!</li>
246324
</div>
247325

248326
<div class="sidebar-item">
249327
<h5 class="sidebar-title">Contributors</h5>
250328
<ul class="p-0" id="contributorsList">
251-
<ul class="list-group list-group-flush"><li class="list-group-item d-flex align-items-center"><img src="https://avatars.githubusercontent.com/u/108202?v=4" alt="kamens" class="rounded-circle me-3" style="width: 40px; height: 40px;"><div><a href="https://github.com/kamens" target="_blank" class="text-decoration-none fw-bold">kamens</a><p class="mb-0 text-muted small">32 contributions</p></div></li></ul>
329+
<ul class="list-group list-group-flush" id="contributorsList"><li class="list-group-item d-flex align-items-center contributor-item"><img src="https://avatars.githubusercontent.com/u/108202?v=4" alt="kamens" class="rounded-circle me-3" style="width: 40px; height: 40px;"><div><a href="https://github.com/kamens" target="_blank" class="text-decoration-none fw-bold">kamens</a><p class="mb-0 text-muted small">32 contributions</p></div></li></ul>
252330
</ul>
253331

254332
</div>
@@ -294,6 +372,7 @@ <h5 class="sidebar-title">Contributors</h5>
294372
<!-- Bootstrap Bundle JS -->
295373
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
296374
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
375+
<script src="/js/script.js"></script>
297376
<!-- Google tag (gtag.js) -->
298377
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FG2ZX76XGT"></script>
299378
<script>

0 commit comments

Comments
 (0)