Boa tarde,
Tenho este código que me gera um Modal Box, no entanto não está a funcionar:
jQuery(function() {
var modalHtml =
'<div id="open-modal" class="modal-window">' +
' <div>' +
' <a href="#" title="Close" class="modal-close">Close</a>' +
' <h1>Voilà!</h1>' +
' <div>A CSS-only modal based on the :target pseudo-class. Hope you find it helpful. <a href="#" target="_blank">Say hello on Twitter.</a></div>' +
' </div>' +
'</div>';
// insert HTML dynamically
jQuery(".modal-dialog").html(modalHtml);
// display
jQuery(".modal-dialog").modal('show');
// append a new element to the DOM
jQuery('body').after('<div class="modal-dialog modal"></div>');
});;
O que poderei alterar para que ele funcione? Também queria que ao dar refresh na página que ele executasse sempre o código.