Enlace URL directo a la ventana emergente Modal (SimpleModal)
Frecuentes
Visto 1,959 veces
1
Is there a way to have a direct URL link to a modal popup using SimpleModal? What I mean is that if I go to that URL, the modal would be already popped up.
2 Respuestas
1
In case you only want the modal to show when users come from a specific referring url, this will work:
$(document).ready(function () {
var pathname = $(location).attr('href');
if (pathname.indexOf("modalA") >= 0) {
$('#modalA').show();
}
});
and this for when you want different referring urls to open different modals:
$(document).ready(function () {
var pathname = $(location).attr('href');
if (pathname.indexOf("modalA") >= 0) {
$('#modalA').show();
}
else if (pathname.indexOf("modalB") >= 0) {
$('#modalB').show();
}
else {
$('#modalC').show();
}
});
Respondido 23 Oct 13, 22:10
0
You need to open the modal on load of the window. As per the document your have provided, I think the following should work. This code should be written in the document which URL you are going to open.
window.onload=function(){
$("#element-id").modal();
};
Respondido el 09 de Septiembre de 13 a las 06:09
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas jquery simplemodal or haz tu propia pregunta.