1. PROMO Upgrade to Pro Membership @ $99 / Lifetime & access all our 16+ premium Divi extensions: Divi Block, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved Dropdown Window Divi Menu problem on mobile only in product pages

Discussion in 'Free Divi Community Forum' started by simoneapi, Nov 9, 2020.

  1. simoneapi

    simoneapi New Member

    Hello! I have this problem here:

    In "Screenshoot 1" you can see that the dropdown window is on full width correctly, but when I go on product pages "Screenshoot 2", it changes the width. I tried everything but I'm still not able to make it right.

    This is the code I'm using to make the nested dropdown menu works:

    <style>
    .et_mobile_menu .first-level > a {
    background-color: transparent;
    position: relative;
    }
    .et_mobile_menu .first-level > a:after {
    font-family: 'ETmodules';
    content: '\4c';
    font-weight: normal;
    position: absolute;
    font-size: 16px;
    top: 13px;
    right: 10px;
    }
    .et_mobile_menu .first-level > .icon-switch:after{
    content: '\4d';
    }
    .second-level {
    display: none;
    }
    .reveal-items {
    display: block;
    }
    .et_mobile_menu {
    margin-top: 20px;
    width: 230%;
    margin-left: -65%;
    }

    </style>

    <script>
    (function($) {

    function setup_collapsible_submenus() {

    var FirstLevel = $('.et_mobile_menu .first-level > a');

    FirstLevel.off('click').click(function() {
    $(this).attr('href', '#');
    $(this).parent().children().children().toggleClass('reveal-items');
    $(this).toggleClass('icon-switch');
    });


    }

    $(window).load(function() {
    setTimeout(function() {
    setup_collapsible_submenus();
    }, 700);
    });
    })(jQuery);

    </script>

    I've been following this tutorial by divi official website:
    https://www.elegantthemes.com/blog/...llapsing-nested-menu-with-divis-theme-builder

    Any help is super appreciated

    Thank you very much

    Simone
     

    Attached Files:

    1. PRO MEMBER PERKS Divi.Help Pro Layout Packs - Modern & powerful Agency Divi layout pack, featuring team carousel, sliding menu, etc.View Demo
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

  3. simoneapi

    simoneapi New Member

    It worked! Thank you very much!

    May I ask you why it did? Im curious

    Thank you again!

    Simone
     
    1. PRO MEMBER PERKS Beautifully crafted custom colored 'Freelancer' Divi layout for all Pro members:View Demo
  4. Divi.Help

    Divi.Help Administrator
    Staff Member

    Cause for the CPT pages, there seems to be other CSS overriding your previous CSS. Thus, adding !important tag to your CSS will override the CPT CSS.