From: Anthony Talarico Date: Wed, 22 Aug 2018 18:19:54 +0000 (-0400) Subject: adding toggle functionality to the off canvas menu item as well as the toggle X-Git-Tag: v1.0.52^2~3 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=4d5c99b25d71ef7e0d7a1907e1f2c98578920756;p=WP-Themes%2Fstaffords.git adding toggle functionality to the off canvas menu item as well as the toggle --- diff --git a/js/app.js b/js/app.js index d9c7397..fc8a6f7 100644 --- a/js/app.js +++ b/js/app.js @@ -14,10 +14,15 @@ $(document).ready(function () { $('ul.children').each(function () { $(this).before(''); }); - $('a.toggle').click('click', function () { + $('a.toggle').click('click', function (e) { $(this).toggleClass('open'); $(this).siblings('ul').toggleClass('open'); }); + $('.left-off-canvas-list').find('.menu-item-has-children').on("click", function(e){ + e.preventDefault(); + $(this).children('a.toggle').toggleClass('open'); + $(this).children('ul').toggleClass('open'); + }) // Custom js and jquery for staffords /////////////////// // reservation for toggle click function /////////////// $("#res-tab a").on('click', function () { diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 399bdda..ee9acb2 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -5,10 +5,15 @@ $(document).ready(function () { $('ul.children').each(function () { $(this).before(''); }); - $('a.toggle').click('click', function () { + $('a.toggle').click('click', function (e) { $(this).toggleClass('open'); $(this).siblings('ul').toggleClass('open'); }); + $('.left-off-canvas-list').find('.menu-item-has-children').on("click", function(e){ + e.preventDefault(); + $(this).children('a.toggle').toggleClass('open'); + $(this).children('ul').toggleClass('open'); + }) // Custom js and jquery for staffords /////////////////// // reservation for toggle click function /////////////// $("#res-tab a").on('click', function () {