Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1236577
    Alejandro Jose S
    Participant

    Hi,

    I would like to use this new (awesome) plugin you provide us with theme X but i notice that, unfortunatel it doesn’t work very well when used inside cornerstone or with your shortcodes (when triggered by buttons, for example).

    I read another thread on this subject and the solution you gave the other user was to add this code in the customizer:

    /* Open estimation form on button click */
    jQuery('.open-estimation-form').on('click', function(e ) {
      e.preventDefault();
      jQuery('#btnstart').click();
    } );

    Now, #btnstart it’s the button’s ID (if i’m not mistaken) and that should fix the issue, but it didn’t on my end 🙁

    this is my button’s (shortcode) code:

    <div style="text-align: center;">
      [button type="real" shape="pill" size="regular" href="#form" title="Form preventivo e prenotazione" style="background-color:white;" class="open-estimation-form form-2" id="btnstart"]Prenota o chiedi il tuo preventivo![/button]</div>

    open-estimation-form form-2 is the class the plugin created for me to add in links, etc (it doesn’t even work on links inside cornerstone, though T_T ).

    you see, i wanted to create a convertplug slide-in with a button inside that would open that form when clicked. everything works except the click even. the screen moves, so i suppose it does “start” but the popup doesn’t show. i don’t know if any of the settings of the plugin would allow me to avoid this “conflict” (i don’t know if it really is a conflict, though)

    Hope you can help me out!

    #1236580
    Alejandro Jose S
    Participant
    This reply has been marked as private.
    #1236940
    Rad
    Moderator

    Hi there,

    Thanks for writing in.

    What should it do? It will not work because you’re triggering the same button when you click it. If you’ll check this,

    [button ......... class="open-estimation-form form-2" id="btnstart"]

    the class .open-estimation-form is the same button as #btnstart, hence, the code trigger #btnstart when you click .open-estimation-form which basically same button. And that creates loop.

    I need to understand what you’re trying to do and I may able to recommend some workaround based on that.

    Thanks!

    #1237583
    Alejandro Jose S
    Participant

    Sorry, i thought i had removed the ID before, however it doesn’t work either with it (without the form class and with the js snippet) or without it ( with the class and without the js snippet)

    However, take a look at the module again (if you like) and tell me if there’s something wrong with it 🙁 it’s something that has been cracking my head for a while because it doesn’t work unless i create a new page and link to it. the popup version just doesn’t work 🙁

    #1237782
    Rad
    Moderator

    Hi there,

    Have you added the popup? How’s the popup implemented on your page? It should be there and just waiting for trigger, but there is none, even the lightbox isn’t there.

    The thread where you copied the code isn’t actually about popup, the correct term is sliding down and open. There is a form under a big section where the button is, and the code triggers the first step of the form and it automatically slides down and opens the form.

    Hence on your case, you need something like lightbox and capture the form there. Example, let’s say you have the from but hidden.

    <div class="my_hidden_form"><div id="#my_hidden_form">form shortcode here</div></div>
    <style>.my_hidden_form{ display:none; }</style>
    

    Then there should be button and lightbox

    [button class="my-form-lightbox" href="#my_hidden_form"]Click Me[/button]
    [lightbox selector=".my-form-lightbox"]

    Thanks!

    #1238970
    Alejandro Jose S
    Participant

    I figured it out! turns out i had misread the instructions, i thought you could either add the popup shortcode OR add the class, when in reality i had to use BOTH of them for it to work! what a dork, hehe.

    Sorry to have bothered you with that guys 🙂

    i do have one question, though, is it possible to automatically close the slide-in once the pop-up has appeared? do you know what class or JS controls the “toggle” feature of the convertplug’s slide-in?

    #1238979
    Christopher
    Moderator

    You’re welcome 🙂

    #1250268
    Alejandro Jose S
    Participant

    i do have one question, though, is it possible to automatically close the slide-in once the pop-up has appeared? do you know what class or JS controls the “toggle” feature of the convertplug’s slide-in?

    #1250711
    Nabeel A
    Moderator

    Hi again,

    Please add the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript

    jQuery(document).ready(function($){
    	setInterval(function(){ 
    		if(jQuery('.cp-overlay-close').length) {
    			jQuery('.cp-overlay-close').click();
    		}
    	}, 2000);
    });

    Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!

    #1262603
    Alejandro Jose S
    Participant

    that was almost it! thanks to your answer (and to the allmighty inspector) i found out that it was another class that triggered the close event!

    here’s the code i wrote based on your answer and on what i found =D (for all the future users who would like to achieve something like this :p )

    jQuery( function($){
    	  //Close Slide-in after opening form.    
        	$(".close-modal").on('click',function(){
        jQuery('.cp-default-close').click();
     
        });
    });

    you can use the class “close-modal” on any button you want and it will close the desired convertplug popup/slidein/infobar =D

    #1263018
    Rad
    Moderator

    Glad to hear that and thanks for sharing! Cheers!

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