1. PROMO Get 60% OFF Lifetime Pro Membership & access all our Pro Divi Extensions, Divi Layouts, Divi AI Generator, Divi Block, etc.VIEW PRICING
Dismiss Notice
UPDATE Custom Color Scheme + Premade Divi Layouts - A perfect combination to boost productivity. New 'Gadget Repair' layout added.Try our Custom Color Layouts
BEST Divi Block - A revolutionary online drag & drop tool to easily mix & match 478+ premade blocks to kick start your Divi site design. Special module designs are included as well.
Learn MoreTry Free Version

Solved Feature request: close Global Popup with ESC key

Discussion in 'Basic Support Forum' started by ThemeUser, Dec 28, 2021.

  1. ThemeUser

    ThemeUser Member
    Divi Ultimate Child Theme Divi Powerful Child Theme Divi Ultimate Archive Plugin Divi Ultimate Blog Plugin Divi Ultimate Header Plugin Divi Ultimate Footer Plugin

    A common feature with popups is that they can be closed by hitting the ESC key. If this functionality could be added to the Global Popup that would be a plus.
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade floating button design for your Divi site without using any plugins:View Demo
  2. Divi Powerful

    Divi Powerful Administrator
    Staff Member

    Here's the custom code to achieve that. Just paste it in WP Admin > Divi > Theme Options > Integration > Body Code:
    Code:
    <script>
        jQuery(function($){
            $(document).keydown(function(e){
                if(e.keyCode == 27) {
                    $('body').removeClass('free-body-show-popup');
                    $('#free-global-popup').removeClass('free-show-popup');
                }
            });
         });
    </script>
     
  3. ThemeUser

    ThemeUser Member
    Divi Ultimate Child Theme Divi Powerful Child Theme Divi Ultimate Archive Plugin Divi Ultimate Blog Plugin Divi Ultimate Header Plugin Divi Ultimate Footer Plugin

    And... it works! Thanks so much!
     
    1. PRO MEMBER PERKS Divi.Help Pro Layout Packs - Beautifully crafted Divi layout packs for you to kick start your Divi sites:View Demo