Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #608700

    How can I have the mobile menu options dynamically fill the screen regardless of whether it’s vertical or horizontal? I was playing around with the padding, and while that would be an all right solution for just the vertical or horizontal orientations, I’d prefer not to have to manually adjust several @media screen values.

    Is there a way to do this with percentages?

    #609967

    Hi Michae1!

    Thank you for using Enfold.

    Please add this in the functions.php file:

    // menu mobile
    add_action('wp_footer', 'ava_custom_script');
    function ava_custom_script(){
    ?>
    <script type="text/javascript">
    (function($) {
        function a() {
    
            var mh = $('#mobile-advanced').outerHeight() - 89,
                    mi = $('#mobile-advanced').find('.menu-item'),
                    mc = $(mi).length,
                    nh = mh / mc / 2 - 13;
                    
            $('#advanced_menu_toggle').bind('click', function() {
                    $(mi).find('a').css({
                        'padding-top' : nh,
                        'padding-bottom' : nh,
                    });            
            });
    
             $('#advanced_menu_hide').bind('click', function() {
                    $(mi).find('a').removeAttr('style');            
            });       
        }
    
        setTimeout(a(), 1000);
    })(jQuery);
    </script>
    <?php
    }

    And the following css code in the Quick CSS field:

    #mobile-advanced li > a:before, .html_header_mobile_behavior #mobile-advanced span > a:before, #mobile-advanced .mega_menu_title:before {
        top: 40%;
    }

    Regards,
    Ismael

    #609993

    Thanx Ismael,

    Does it need to be in the core theme functions.php? Or can I just use it in my child functions.php? Because I tried the latter, and it didn’t quite work. I say “not quite” because, it looked like the PHP call at the top and bottom either didn’t need to be there or where inverted. So I deleted them to test that, and it actually worked . . . for a second, then it crashed WordPress (doh!). Luckily WPengine has great backup point management :)

    Thoughts?

    ~ Michae1

    #610556

    Hi!

    You can add it in the child theme’s functions.php file. Please post the code of the functions.php file on pastebin.com.

    Regards,
    Ismael

    #610681

    Hi Ismael!

    Here’s the pastebin for my Child Theme Functions. Thanx!!

    http://pastebin.com/EHaFQESe

    #610791

    Hi!

    We updated the code above. Please replace the code. Remove browser cache or hard refresh before testing the page.

    Regards,
    Ismael

    #611517

    Hi Ismael!

    It’s updated in the pastebin? <- if so, I didn’t realize pastebin was collaborative. > Or is there another link? Could you tell me what was changed? Thanx!

    ~ Michael

    #611621
    #612162

    Gothcya, didn’t realize you updated your post. Still no luck though. Now the bullets are just misaligned :( Thoughts?

    #613411

    Hi!

    Works fine when I checked it. Could you please provide a screenshot of the issue? Did you add the css code?

    Cheers!
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.