diff options
author | SkyArrow <tommy351@gmail.com> | 2012-01-24 18:23:47 +0100 |
---|---|---|
committer | SkyArrow <tommy351@gmail.com> | 2012-01-24 18:23:47 +0100 |
commit | 7c05b0a627b22f227084d5144e9eb0879c920a68 (patch) | |
tree | 73491895f8a94d437332e7a1a8026b2eca0f2c08 /source | |
parent | a63d03908153e5d0f2825d5972d726e92f2ad92c (diff) | |
download | octopress-theme-jeyzu-7c05b0a627b22f227084d5144e9eb0879c920a68.zip octopress-theme-jeyzu-7c05b0a627b22f227084d5144e9eb0879c920a68.tar.gz |
<select> menu for mobile devices
Diffstat (limited to 'source')
-rw-r--r-- | source/_includes/custom/after_footer.html | 5 | ||||
-rw-r--r-- | source/javascripts/navigation.js | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/source/_includes/custom/after_footer.html b/source/_includes/custom/after_footer.html index cb1277b..50003bb 100644 --- a/source/_includes/custom/after_footer.html +++ b/source/_includes/custom/after_footer.html @@ -1,5 +1,6 @@ <script src="{{ root_url }}/javascripts/jquery.easing.1.3.js"></script> <script src="{{ root_url }}/javascripts/external.js"></script> -<script src="{{ root_url }}/javascripts/twitter.js"></script> +<script src="{{ root_url }}/javascripts/navigation.js"></script> <script src="{{ root_url }}/javascripts/jquery.fancybox.pack.js"></script> -<script src="{{ root_url }}/javascripts/caption.js"></script>
\ No newline at end of file +<script src="{{ root_url }}/javascripts/caption.js"></script> +<script src="{{ root_url }}/javascripts/twitter.js"></script>
\ No newline at end of file diff --git a/source/javascripts/navigation.js b/source/javascripts/navigation.js new file mode 100644 index 0000000..546edf1 --- /dev/null +++ b/source/javascripts/navigation.js @@ -0,0 +1,16 @@ +(function($){ + var appends = '<option>選單</option>'; + + $('.menu .main > li').each(function(){ + var link = $(this).children('a'); + appends += '<option value="'+link.attr('href')+'">'+link.html()+'</option>'; + $(this).find('li').each(function(){ + var link = $(this).children('a'); + appends += '<option value="'+link.attr('href')+'">- '+link.html()+'</option>'; + }); + }); + + $('nav.menu').append('<select>'+appends+'</select>').on('change', 'select', function(){ + location.href = $(this).val(); + }); +})(jQuery);
\ No newline at end of file |