From e3cc2b2ff5d96ed69c982c100692a1745bc261ef Mon Sep 17 00:00:00 2001 From: Tommy Chen Date: Sun, 3 Jun 2012 10:20:50 +0800 Subject: rewrite navigation.js --- source/javascripts/navigation.js | 16 --------------- source/javascripts/slash.js | 42 ++++++++++++++++++++++++++++------------ 2 files changed, 30 insertions(+), 28 deletions(-) delete mode 100644 source/javascripts/navigation.js diff --git a/source/javascripts/navigation.js b/source/javascripts/navigation.js deleted file mode 100644 index 652aafa..0000000 --- a/source/javascripts/navigation.js +++ /dev/null @@ -1,16 +0,0 @@ -(function($){ - var appends = ''; - - $('.menu .main > li').each(function(){ - var link = $(this).children('a'); - appends += ''; - $(this).find('li').each(function(){ - var link = $(this).children('a'); - appends += ''; - }); - }); - - $('nav.menu').append('').on('change', 'select', function(){ - location.href = $(this).val(); - }); -})(jQuery); \ No newline at end of file diff --git a/source/javascripts/slash.js b/source/javascripts/slash.js index 270f39c..0105d69 100644 --- a/source/javascripts/slash.js +++ b/source/javascripts/slash.js @@ -14,22 +14,40 @@ }); }; + // Append menu for mobile device + var navigationMenu = function(){ + var appends = ''; - /* navigation.js */ - var appends = ''; + var search = function(obj, level){ + var children = obj.children(), + link = children.eq(0), + _level = level + 1; - $('.menu .main > li').each(function(){ - var link = $(this).children('a'); - appends += ''; - $(this).find('li').each(function(){ - var link = $(this).children('a'); - appends += ''; + appends += '