I know there are more efficient ways at doing this but I have my reasons for doing it this way. I have a modal popup window. I would like for this window to pop up as soon as the visitor loads the page. As of right now the window is reached and opened by clicking a link that takes them to index.php#login_form.
"#login_form" being what I would like to add the URL on page load. Then they can chose to exit it once it has initially loaded with the popup.
Now is there a way to do this more efficiently with out having to change my css or code very much?
Thanks!
One easy way is to load the page directly with the hashtag login_form:
Or if you want to be more "precise" you can use jquery like this:
You can use jquery to show the modal when the window is loaded: Try this code and you'll understand:
You'll add the code to show the modal instead of the alert function. If the modal is shown or hidden with css, you can easily add a css class to an element with:
Or remove a class with:
Be sure to have the jquery library imported. I hope this answers your question.