Support » Plugin: Hustle - Pop-Ups, Slide-ins and Email Opt-ins » Disable ESC key to close popup

  • Resolved N’Ckyola

    (@nckyola)


    Is there a way to disable the esc key to exit a Hustle pop-up?
    I have added the following code but it still allows use of the esc key:

    add_action( ‘wp_footer’, ‘disable_esc_key’, 999 );
    function disable_esc_key() {
    ?>
    <script>
    ( function( $ ) {
    $( document ).off( ‘keydown’ );
    $( document ).on( ‘keydown’, function( e ) {
    if ( e.keyCode === 27 ) {
    return false;
    }
    } );
    } )( jQuery )
    </script>
    <?php

    The page I need help with: [log in to see the link]

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