This topic has 1 reply, 2 voices, and was last updated 11 years, 9 months ago by Wajid Khan.
Viewing 2 posts - 1 through 2 (of 2 total)
Hi MAWK,
I am trying to hide a superfish sub-menu if a user clicks on any sub-menu item. The sub menu remains open by default after you click on it, which is not very user friendly, especially if the menu is a large one. The javascript code works only on the first page load, but not after an AJAX call. Do you know where I need to put the code for it to work after an AJAX call in the theme, or how I need to make that call?
Here’s the javascript, which works on the latest template version (http://www.aivahthemes.com/musicplay/) to hide the second sub-menu after you click on any one of the items in it. If you put this code towards the end in footer.php (just for testing purposes), it will work. But it won’t work after navigating to a different page after an AJAX callback.
<script type=”text/javascript>
(function($){
var mql=window.matchMedia(“screen and (min-width: 777px)”);
if(mql.matches){
var mymenu=$(‘#atp_menu’).superfish({});
$(‘.sub-menu’).on(‘click’,function(){
$(‘#atp_menu’).children(‘li:nth-child(2)’).superfish(‘hide’);
});
}
})(jQuery);
</script>
Your help would be appreciated.
Thanks.
Its there in ajaxify.js file located in js folder where you can add the call back. Please try contacting me via Skype if you have further issues.
Regards,
Mawk
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.