0
I need to open a modal zurb-foundation
via URL
. For example http://sistema.com.br/agenda/#modal99
Follows the code:
Html:
<a href="#modal99">Show Modal</a>
Javascript:
$('#modal99').foundation('open');
The code does not open the modal.
Note: I cannot use <a data-open="modal99">Show Modal</a>
.
And neither <a id="modal99">Show Modal</a>
.
It has to be via href
.
In Javascript tries
$('#modal99').foundation('reveal', 'open');
– BrTkCa
Doesn’t open @Lucascosta yet
– Eduardo Santos
I made a fiddle by taking the event click on the link and opening a modal and it worked.. is that what you need? https://jsfiddle.net/lbclucascosta/sqyd9xbc/1/
– BrTkCa
@Lucascosta I can’t use
id="modal99"
as I mentioned in the observation. It has to be viahref
.– Eduardo Santos
There is no way to point a href and change the shape of the modal. I don’t know why you need to do it this way, but one solution is to use the selector
href
in Jqquery and open the modal, more or less like this:$("[href='#modal99']")
: https://jsfiddle.net/lbclucascosta/sqyd9xbc/2/– BrTkCa
Your example works, but you wanted something like this. var url = Document.URL.split('#'); var modalUrl = (url[url.length - 1]); $('#modal' + modalUrl). Foundation('open'');
– Eduardo Santos
Let’s go continue this discussion in chat.
– Eduardo Santos
The most effective solution is to use the fullcalendar array. Which would be: eventClick: Function (Event) { var key = Event. _id; $('#modal' + key). Foundation('open'); }
– Eduardo Santos