Automatic modal when starting home page

Hello Pealco.
Greetings from Budapest…

Do you mind look at this once again?

I used your script to open the modal for opt_in on opening the page. But, how can it be kept open until someone click a button. Modal should not close by esc or clicking outside the modal. Only by clicking the submit buttion, which will send the data by email, and show the landingpage. Or they click the no button, which will move the visitor to the home page.
Hope you are available on this…

@Pealco-

I found your website with the snippets and it works now.

Thanks a lot for sharing…

Regards,

Jan F.

Just thought I’d mention that Cadence is a solution that uses local storage instead of cookies and has a ton of options that might interest anyone looking for a robust modal automation solution.

2 Likes

@pruthe Thank you for the example! It helped me a lot sorting out a problem with a timed modal after updating a project to bootstrap 5.

1 Like

i tried to replicate the automated modal, which is opened every time the page is loaded, that @Pealco (thank you!!!) exemplifies in this thread.

but i just cant do it. seems like i am blind and/or totally stupid.

i’ve uploaded a small test-bloc, if anyone could help, i would really appreciate this very, very much:
www.thegatescontinuum.com/test_aut_modal.zip

thanks a million times in advance!!!

To simplify your life you might want to get your hands:

@jerry thank you very much. i purchased nearly all addons from whittfield (except cadence) and i love them. But he is missing since april and i think, theres a good chance the brics won`t be updated.

and actually i really want to see what i am doing wrong, so i can learn …

The script uses jQuery which is replaced with pure javascript in Bootstrap 5. In short, you will need to modify this. It should be working when you choose Bootstrap 4 as framework.

@Jerry okay, what shall i do, open a new thread and ask for answers? because i rather don`t want to spam the forum and i want to use bootstrap 5?

i simply would like to get the answer, how an automated modal at loading the page is doable in blocs 5 :slight_smile:

thank you very much in advance

That is a contradiction to what you mentioned earlier:

Without testing, something like this should work:

document.addEventListener("DOMContentLoaded", function() {
    var modal = document.getElementById(‘#my-fancy-modal);
    if (modal && modal.classList) {
        modal.classList.add('show');
        if (modal.classList.contains('fade')) {
            modal.style.display = 'block';
        }
    }
});

@jerry thank you, but it doesn*t work, i put it as script in the header and changed the modal ID …

and btw. it´s no contradiction. Many people have very different ways of learning and i think that everybody has the right and should have the opportunity to find her or his way. i by the way am neurodivergent, have ADHD and have a very different way of learning to most people i know.

For me, it does… :thinking::

Small Potato 2023-10-27 at 20.21.18

1 Like

@Jerry would you please just write down, what i have to put where? thank you very much in advance.

I replaced your script with my script, that’s all I did.

1 Like

@jerry thats cool, would you send me the file, because i just don´t know where the mistake could be?

@Jerry … please, keep cool :wink:

Your question has been thoroughly addressed by me, and it’s a pleasure to assist individuals like you. Along with a few others, I am here to provide help at no cost. However, my assistance only extends to providing solutions, as I have done.

1 Like

@smalltiger I think Jerry has tried to help you, just as he has helped countless others, freely giving up his own time for no reward.

I would appreciate if you could close this topic. The question has been answered and the questioner has become personal with a forum member.

2 Likes