• Resolved kiwidesign

    (@kiwidesign)


    Hello there!

    Since I already had a signup form at the bottom of my homepage, I added a button to the slide-in that links to an anchor were the signup form is, like https://www.homepage.com/#newsletter

    I would like the slide-in to be dismissed when the user click on this button, but I have not found an apparent way to do that…
    The button works as intended “jumping” to the signup form, but the slider stays visible on the homepage.

    Any way to solve this?
    Thanks!

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hey @kiwidesign,

    Hope you’re well.

    There is no option for that in the current version of Hustle, but you can do that by adding custom JS codes. If you add that codes to your page it will hide slide-in once user click that button;

    jQuery("#wph-modal-slide_in--2 .wph-modal--cta").click(function(){
        jQuery("#wph-modal-slide_in--2").hide();
    });

    I hope that helps!

    Cheers,
    Oguz

    Thread Starter kiwidesign

    (@kiwidesign)

    Hello and thanks for the quick answer!
    I included the script in the header, but it’s not working and the web inspector gives the error “ReferenceError: Can’t find variable: jQuery”

    I’m fairly certain that jQuery is loaded by the theme already (this is the page) so I don’t get why it wouldn’t work :/

    Thank you!

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hey @kiwidesign,

    Hope you’re well.

    If you are sure there is a jQuery on your page, that means you are trying to put the code that I gave you before jQuery load. You should put it after jQuery loaded. Just for being sure you can add that jQuery codes before body closing tag in the footer. Body closing tag looks like this “</body>”, so add just one line over it.

    Cheers,
    Oguz

    Thread Starter kiwidesign

    (@kiwidesign)

    Hi Oguz and thanks again,
    it looks like the script is loading correctly now, but still doesn’t work…

    have a look if you can: https://www.devyoucan.it/manymal/
    (the slide-in appears after scrolling a little)

    thank you so much!

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hey @kiwidesign,

    Hope you’re well.

    Can you try this version of the code;

    jQuery("body").on('click', '#wph-modal-slide_in--2 .wph-modal--cta', function(){
    	jQuery("#wph-modal-slide_in--2").hide();
    });

    Please let me know the results.

    Cheers,
    Oguz

    Thread Starter kiwidesign

    (@kiwidesign)

    Worked beautifully, thank you so much Oguz!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Close slide-in on button click’ is closed to new replies.