Permalink
Browse files

Flaunt JS

  • Loading branch information...
1 parent 915fe8e commit b4c2e340c23f2e6fdfaef16c04b4b4c58509ff84 Todd Motto committed Mar 24, 2013
Showing with 9 additions and 13 deletions.
  1. BIN .DS_Store
  2. +3 −1 css/demo.css
  3. +4 −10 js/flaunt.js
  4. +2 −2 js/flaunt.min.js
View
BIN .DS_Store
Binary file not shown.
View
@@ -152,8 +152,10 @@ ol {
-webkit-border-radius:5px 5px 0 0;
-moz-border-radius:5px 5px 0 0;
}
+ .nav-item:hover .nav-submenu {
+ display:none;
+ }
.nav-submenu {
- display:none !important;
position:static;
width:100%;
}
View
@@ -1,7 +1,7 @@
/*
Flaunt.js v1.0.0
by Todd Motto: http://www.toddmotto.com
- Latest version: https://github.com/toddmotto/flauntjs
+ Latest version: https://github.com/toddmotto/flaunt-js
Copyright 2013 Todd Motto
Licensed under the MIT license
@@ -27,15 +27,9 @@
// Dynamic binding to on 'click'
$('.nav-list').on('click', '.nav-click', function(){
-
- // Positive and negative clicks
- var clicks = $(this).data('clicks');
- if (!clicks) {
- $(this).siblings('.nav-submenu').attr('style','display: block !important');
- } else {
- $(this).siblings('.nav-submenu').removeAttr('style');
- }
- $(this).data('clicks', !clicks);
+
+ // Toggle the nested nav
+ $(this).siblings('.nav-submenu').toggle();
// Toggle the arrow using CSS3 transforms
$(this).children('.nav-arrow').toggleClass('nav-rotate');
View
@@ -1,12 +1,12 @@
/*
Flaunt.js v1.0.0
by Todd Motto: http://www.toddmotto.com
- Latest version: https://github.com/toddmotto/flauntjs
+ Latest version: https://github.com/toddmotto/flaunt-js
Copyright 2013 Todd Motto
Licensed under the MIT license
http://www.opensource.org/licenses/mit-license.php
Flaunt JS, stylish responsive navigations with nested click to reveal.
*/
-;(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);
+;(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 comments on commit b4c2e34

Please sign in to comment.