Work on dynamic Off-canvas pulled from livesite nav
authorLaury GvR <laury@gaslightmedia.com>
Tue, 21 Apr 2015 21:03:43 +0000 (17:03 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 21 Apr 2015 21:03:43 +0000 (17:03 -0400)
footer.php
header.php
parts/glm-header.php
parts/off-canvas-menu.php
proxy.php [new file with mode: 0644]

index a4270fe..8ea8a33 100644 (file)
@@ -1,9 +1,26 @@
                     </div><!--End of main-->
                 </div><!--End of shadow-->
+                
+          <a class="exit-off-canvas"></a>
+            </div>
             </div>
-        <a class="exit-off-canvas"></a>
         </div><!--End of inner-wrap-->
       </div><!--End of off-canvas-->  
+      
+        <script>
+         jQuery.ajax({
+         url: '<?php bloginfo('template_url'); ?>/proxy.php?s=off-canvas',
+         cache: false
+         })
+             .done(function( html ) {
+             jQuery( ".left-off-canvas-menu" ).append( html );
+             jQuery('.off-canvas-list').find('a.toggle').click(function() {
+                 jQuery(this).toggleClass('open');
+                 jQuery(this).siblings('ul').toggleClass('open');
+             });
+            });
+        </script>
   </body>
+  
   <?php wp_footer();?>
 </html>
\ No newline at end of file
index d419636..41866f0 100644 (file)
                 <div class="shadow-wrapper">
                     <header>
                         <?php get_template_part('parts/off-canvas-menu');?>
+<!--                        <div id="menu_btn">
+                            <a class="left-off-canvas-toggle menu-icon" href="#">
+                                <span>
+                                    <img src="http://www.discoverkalamazoo.com/assets/menu_btn.png">
+                                </span>
+                            </a>
+                        </div>-->
+
                     </header>
index 0d3ca25..65f4dc3 100644 (file)
@@ -3,13 +3,7 @@
                 <a class="top_hashpound" href="http://discoverkzoo.DiscoverKalamazoo.com" target="_blank">
                     #discoverkzoo
                 </a>
-                    <div id="menu_btn">
-                        <a class="left-off-canvas-toggle menu-icon" href="#">
-                            <span>
-                                <img src="http://www.discoverkalamazoo.com/assets/menu_btn.png">
-                            </span>
-                        </a>
-                    </div>
+                    
                     <div id="search_btn"><img src="http://www.discoverkalamazoo.com/assets/search_btn.png" width="40" height="40"></div>
                     <div id="search_form_wrapper">
                         <form action="http://www.discoverkalamazoo.com" id="searchForm" name="searchForm" method="get">
index a217dc1..e8b3b81 100644 (file)
@@ -1,4 +1,4 @@
-<aside class="left-off-canvas-menu show-for-medium-down">
+<!--<aside class="left-off-canvas-menu show-for-medium-down">
     <?php glm_offcanvas_menu(); ?>
     
     <div class="off-canvas-social">
         <?php get_template_part('parts/address');?>
     </div>
 </aside>
-                        
\ No newline at end of file
+                        -->
+
+                        <nav class="tab-bar show-for-medium-down">
+                            <section class="left-small">
+                                <a class="left-off-canvas-toggle menu-icon" href="#"><span>Menu</span></a>
+                            </section>
+                        </nav>
+                        <aside class="left-off-canvas-menu">
+                        </aside>
\ No newline at end of file
diff --git a/proxy.php b/proxy.php
new file mode 100644 (file)
index 0000000..207f729
--- /dev/null
+++ b/proxy.php
@@ -0,0 +1,20 @@
+<?php
+        // create curl resource
+        $ch = curl_init();
+        $option = filter_input(INPUT_GET, 's');
+
+        // set url
+        if ($option == 'off-canvas') {
+            curl_setopt($ch, CURLOPT_URL, "http://www.discoverkalamazoo.com/off-canvas-nav.php");
+        }
+
+        //return the transfer as a string
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+
+        // $output contains the output string
+        $output = curl_exec($ch);
+
+        // close curl resource to free up system resources
+        curl_close($ch);     
+        echo $output;
+?>
\ No newline at end of file