Open a banner when you visit the site

Asked

Viewed 329 times

-2

I need to put an image to open automatically when accessing the site, but I’m kind of lost in it.

  • Specify your question better! How do you want to open? in pop-up? html itself '<img src="..."/>'... edit your question so we can try to help you better.

1 answer

1

You can use a modal to display an image when the site is loaded.

There are several libraries that include modals, such as Bootstrap, Foundation, Bulma, Semanticui, etc....

If you don’t use any of them you also have libraries that work alone or with jQuery. A quick search and I found these: Vex, Tingle and Simplemodal.

Theoretically it would just add one Handler to the event DOMContentLoaded in javascript.

// Com jQuery
$(document).ready(function(){
    // Criar e ativar modal aqui
})

// Sem jQuery
document.addEventListener("DOMContentLoaded", function(event) {
    // Criar e ativar modal aqui
});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.