Okay
  Public Ticket #1324454
Modal switch not working
Closed

Comments

  •  1
    sumonmg started the conversation

    Hi, I have been trying to implement modal switch for hours but it's not working. What I want is that first clicking on a button will open a modal, then inside that modal I have another button, so when I click on that button, it would hide the current modal and open the other modal.

    I have searched google many times, there are lots of solution, and there are online demos as well, they work fine. But as soon as I try the same inside my neon theme, it doesn't work.

    For example, here is one demo that works: http://jsfiddle.net/5qCm9/

    And I have implemented this same code into here: https://clippingpathindia.myshopify.com/a/portal-dev/articles

    Look for the 2 buttons (modal1 and modal2) at the bottom of this page.

    Any idea how to resolve this issue?

  • [deleted] replied

    Hi sumonmg,

    I have added this slightly modified code:

    jQuery( '#close1_open2' ).unbind().on( 'click', function( ev ) {
    $( '#modal1' ).modal( 'hide' );
    setTimeout( function() {
    $( '#modal2' ).modal( 'show' );
    }, 500 );
    } );

    This worked for me by adding this timeout to wait the modal to be closed. I am not sure why is not working with the current code but this solves the problem.