Linking to modal


Topic: Linking to modal

pawled asked 3 years ago

Is it possible to open modal after entering proper URL?


Grzegorz Bujański staff commented 3 years ago

What do you mean? Can you say something more about this feature?


pawled commented 3 years ago

I mean entering URL www.website.com/category/#examplemodal which opens modal with id=examplemodal at category page.


Grzegorz Bujański staff answered 3 years ago

Unfortunately, there is no such built-in option/method. But you can easily achieve it yourself.

const myModalEl = document.getElementById('exampleModal')
const modal = new mdb.Modal(myModalEl)

if (window.location.hash === '#exampleModal') {
  modal.show()
}

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.9.0
  • Device: Any
  • Browser: Any
  • OS: Any
  • Provided sample code: No
  • Provided link: No
Tags