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

Custom Header Divi

Discussion in 'Free Divi Community Forum' started by Dave_Fish_, Feb 27, 2023.

  1. Dave_Fish_

    Dave_Fish_ New Member

    Hi, i would like to develop an header like elegant theme, i have setting menu on transparent BG and on a white BG when scroll website. On mobile version i'd like to turn BG on color when i click on menu icon on top of the page because when i click on menu in mobile version (top of the page) menu remains transparent and drop down menu have white background and it's very ugly.

    I hope was clear, but i attached a link to a video to explain better.
    http://davidef16.sg-host.com/wp-content/uploads/2023/02/RPReplay_Final1677173695.mp4


    Thank you so much!
     
    1. PRO MEMBER PERKS Divi Mini Cart Pro Plugin - Instantly add 3 different types of mini cart to your Divi site:Learn More
  2. Problemizer.com

    Problemizer.com Divi Expert

    Hello Dave,

    Does this code work
    Code:
    Log In or Sign Up to view this code.
    for you?
     
  3. Dave_Fish_

    Dave_Fish_ New Member

    Hi and thank you so much for your answer.

    I try your code but it doesn’t work, and gives me a few errors.

    How can I fix it?

    thx!!!
     

    Attached Files:

    1. PRO MEMBER PERKS Divi Block Pro - Premade testimonial carousel design for your Divi site without using any plugins:View Demo
  4. Problemizer.com

    Problemizer.com Divi Expert

    Hello Dave,

    I meant if it works for you when you add it to your website. Not through a linter.

    The code is tested on a Divi website and is working.
     
  5. Dave_Fish_

    Dave_Fish_ New Member

    Hi, of course i tested code on my wordpress website through divi css panel. But not works for me. I only check css on a linter.
    How can you see, i add code for this site and it doesn't work.
     

    Attached Files:

    1. PRO MEMBER PERKS Divi Ultimate Child Theme - Tons of premade layouts & section designs + functionalities for your Divi site:Learn More
  6. Problemizer.com

    Problemizer.com Divi Expert

    The code didn't work because you are using a custom header. Here is the revised code which is tested on your website.


    Code:
    Log In or Sign Up to view this code.
     
  7. Dave_Fish_

    Dave_Fish_ New Member

    Hi and thank you so much. Now on phone works well but on tablet doesn't work.
    Could you suggest anything else about tablet issue?

    Thank you sooooo much!
     
    1. PRO MEMBER PERKS Divi.Help Pro Layout Packs - Agency Divi layout pack featuring unique comment design on single blog post page:View Demo
  8. Problemizer.com

    Problemizer.com Divi Expert

    This should work then.


    Code:
    Log In or Sign Up to view this code.
     
  9. Dave_Fish_

    Dave_Fish_ New Member

    i try to change max-width parameters, but on tablet doesn't work
     

    Attached Files:

    1. PRO MEMBER PERKS Divi Block Pro - Easy-to-use drag & drop interface to mix & match 456+ premade Divi blocks & export as json file:Learn More
  10. Problemizer.com

    Problemizer.com Divi Expert

    I tried the code I sent you on your website, and it worked.

    How are you testing tablet width? Using a real device or just resizing a browser window?

    If it is a real tablet, please share what model.
     
  11. Dave_Fish_

    Dave_Fish_ New Member

    real devices, ipad pro 10,5 and galaxy tab s5e
     
    1. PRO MEMBER PERKS Divi.Help One-Page Layouts - Beautifully crafted one-page Divi layouts just for you:View All Layouts
  12. Problemizer.com

    Problemizer.com Divi Expert

    Can you send me a screenshot of the website from the tablet? Or the image of a tablet
     
  13. Dave_Fish_

    Dave_Fish_ New Member

    ipad pro 10,5
     

    Attached Files:

    1. PRO MEMBER PERKS Divi Block Pro - Powerful Divi header builder for you to mix & match premade header design, mobile menu & more:Learn More
  14. Problemizer.com

    Problemizer.com Divi Expert

    What browser are you using on the iPad pro 10?
     
  15. Dave_Fish_

    Dave_Fish_ New Member

    Chrome, but even on firefox doesn't work..
     
    1. PRO MEMBER PERKS Divi Ultimate Header Plugin - Custom Divi Builder header on desktop + default slide in / fullscreen menu on mobile:Learn More
  16. Problemizer.com

    Problemizer.com Divi Expert

    Let's try a different approach. Please remove the CSS code and add the following Javascript code to Divi -> Theme Options -> Integration -> Add code to head.

    HTML:
    <script>
    window.addEventListener('DOMContentLoaded', (event) => {
         var header = document.querySelector('header.et-l .et_pb_section_0_tb_header');
      var opened = header.querySelector('.opened');
    
      if (opened) {
        header.style.backgroundColor = 'white';
      } else {
        header.style.backgroundColor = 'initial';
      }
    });
    </script>
     
  17. Dave_Fish_

    Dave_Fish_ New Member

    Unfortunately script doesn't work..
     
    1. PRO MEMBER PERKS Custom Color Scheme + Premade Layouts - A perfect combination to boost productivity:Try Now
  18. Samed Kavak

    Samed Kavak New Member

    Hey,
    I can recommend you the plugin DIVI Pixel. A lot of options and looks good. I used on this page for example: https://racetrck.de/