Tagged: mobile menu, social icon
HI
You gave me this code to add my social icons to the bottom of my mobile menu.
works great
I just changed my menu on pc from text to icon, and am seeing the social icon on that menu also,
and when the menu is opened then the icon in my header disappears.
I’d like to keep the icon in the mobile burger flyout but keep it only in the header for pc.
is that possible?
// add social icons inside the mobile menu
function ava_custom_script_mod_social(){
?>
<script>
(function($){
var int = '';
function a() {
var isMobile = $('.av-burger-menu-main').css('display'),
htmlString = $('#header_main .social_bookmarks').find('li a'),
mobileMenu = $('.av-burger-overlay'),
socialString = [];
if(isMobile == 'none') return;
if($('.burger-social').length) clearInterval(int);
htmlString.each(function() {
var socialClass = $(this).parent('li').attr('class'),
socialItems = $(this).wrap('<li class="'+ socialClass + ' av-active-burger-items burger-social"></div>').parent().unwrap();
socialString.push(socialItems);
});
$(socialString).each(function() {
$(this).appendTo('#av-burger-menu-ul');
});
}
$('#header').on('mousedown', '.av-main-nav-wrap', function() {
int = setInterval(function() {
a();
}, 500);
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'ava_custom_script_mod_social');
Hey Munford,
Thank you for the inquiry.
This is a better and more simple version of the script above.
Please remove the current script and use that one instead. It should also fix the issue that you described above.
Best regards,
Ismael