Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1205700
    jmartinos
    Participant

    Hello,

    I have installed the Convertplug extension and created my own submission form. So far it looks the way I want it to, but is there a way to set it so that when someone clicks outside of the slide-in box/form, it hides (similar to clicking the close button)?

    My research says it should be able to be done through javascript, and I have a custom javascript plugin, but I’m not sure how I would write the javascript to do this.

    The website it http://www.eliteithome.com/lp

    Thank you in advance.

    #1206072
    Rad
    Moderator

    Hi there,

    Thanks for writing in.

    Please add this code to your custom javascript.

    jQuery( function($) {
    
    $(document).on('click','.cp-overlay', function(e) { e.stopPropagation(); $(this).off('click'); return false;} );
    
    } );

    Thanks!

    #1206908
    jmartinos
    Participant

    Thank you for your response, for some reason that code is making it so my slide in form isn’t showing up now. Is there another option?

    Thank you!

    #1207518
    Rue Nel
    Moderator

    Hello There,

    Thanks for the updates! To resolve your issue, please add the following JS code in the customizer, Appearance > Customize > Custom > Javascript

    (function($) {
      $(document).ready(function(){
    	$('.cp-slidein-global').on('click touchend', function() {
    	  if ($('.smile-slideInRight').length > 0) {
    	    $('.slidein-overlay-close').trigger('click');
    	  }
    	});
      });
    })(jQuery);

    And then please also add the following css code in the customizer, Appearance > Customize > Custom > CSS

    .cp-slidein-global {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
    }

    This will make sure that when you click outside of the slide in form, it will close just like clicking on the X button.

    We would loved to know if this has work for you. Thank you.

    #1210488
    jmartinos
    Participant

    It looks like that did it. Thank you very much!

    #1210565
    Nabeel A
    Moderator

    Glad we could help 🙂

    Cheers!

    #1211654
    jmartinos
    Participant

    Upon further inspection, it looks like using this code is making it so all of my clickable links on the pages I am having this slide-in form show up on, are no longer clickable. Even my footer is not clickable anymore, but once I remove the CSS and JS you recommended, they all become clickable again. Is there a solution to this?

    Thank you.

    #1211877
    Jade
    Moderator

    Hi there,

    Please try to update this code:

    .cp-slidein-global {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
    }

    to

    .cp-slidein-global {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: -1;
    }
    #1211902
    jmartinos
    Participant

    That seems to have worked. Thank you!

    #1212030
    Joao
    Moderator

    Glad to hear it,

    Joao

  • <script> jQuery(function($){ $("#no-reply-1205700 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>