summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/_includes/custom/after_footer.html5
-rw-r--r--source/javascripts/navigation.js16
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