Skip to content

Commit b4c2e34

Browse files
author
Todd Motto
committed
Flaunt JS
1 parent 915fe8e commit b4c2e34

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

.DS_Store

6 KB
Binary file not shown.

css/demo.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,10 @@ ol {
152152
-webkit-border-radius:5px 5px 0 0;
153153
-moz-border-radius:5px 5px 0 0;
154154
}
155+
.nav-item:hover .nav-submenu {
156+
display:none;
157+
}
155158
.nav-submenu {
156-
display:none !important;
157159
position:static;
158160
width:100%;
159161
}

js/flaunt.js

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Flaunt.js v1.0.0
33
by Todd Motto: http://www.toddmotto.com
4-
Latest version: https://github.com/toddmotto/flauntjs
4+
Latest version: https://github.com/toddmotto/flaunt-js
55
66
Copyright 2013 Todd Motto
77
Licensed under the MIT license
@@ -27,15 +27,9 @@
2727

2828
// Dynamic binding to on 'click'
2929
$('.nav-list').on('click', '.nav-click', function(){
30-
31-
// Positive and negative clicks
32-
var clicks = $(this).data('clicks');
33-
if (!clicks) {
34-
$(this).siblings('.nav-submenu').attr('style','display: block !important');
35-
} else {
36-
$(this).siblings('.nav-submenu').removeAttr('style');
37-
}
38-
$(this).data('clicks', !clicks);
30+
31+
// Toggle the nested nav
32+
$(this).siblings('.nav-submenu').toggle();
3933

4034
// Toggle the arrow using CSS3 transforms
4135
$(this).children('.nav-arrow').toggleClass('nav-rotate');

js/flaunt.min.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
22
Flaunt.js v1.0.0
33
by Todd Motto: http://www.toddmotto.com
4-
Latest version: https://github.com/toddmotto/flauntjs
4+
Latest version: https://github.com/toddmotto/flaunt-js
55
66
Copyright 2013 Todd Motto
77
Licensed under the MIT license
88
http://www.opensource.org/licenses/mit-license.php
99
1010
Flaunt JS, stylish responsive navigations with nested click to reveal.
1111
*/
12-
;(function(e){e(function(){e(".nav").append(e('<div class="nav-mobile"></div>'));e(".nav-item").has("ul").prepend('<span class="nav-click"><i class="nav-arrow"></i></span>');e(".nav-mobile").click(function(){e(".nav-list").toggle()});e(".nav-list").on("click",".nav-click",function(){var t=e(this).data("clicks");if(!t){e(this).siblings(".nav-submenu").attr("style","display: block !important")}else{e(this).siblings(".nav-submenu").removeAttr("style")}e(this).data("clicks",!t);e(this).children(".nav-arrow").toggleClass("nav-rotate")})})})(jQuery);
12+
;(function(e){e(function(){e(".nav").append(e('<div class="nav-mobile"></div>'));e(".nav-item").has("ul").prepend('<span class="nav-click"><i class="nav-arrow"></i></span>');e(".nav-mobile").click(function(){e(".nav-list").toggle()});e(".nav-list").on("click",".nav-click",function(){e(this).siblings(".nav-submenu").toggle();e(this).children(".nav-arrow").toggleClass("nav-rotate")})})})(jQuery);

0 commit comments

Comments
 (0)