I use Joomla modal to popup an internal link.

<a class="modal" href="contact-us.html" rel="{size: {x: 480, y: 500}, handler:'iframe'}">Contact Us</a>

I don't want to close the popup window when I click the background. Does anyone know how to prevent the modal closure on that user event?

1 Answer 1


Just a note that behavior.modal uses Mootools and has been removed in Joomla 4, so I'd suggest using bootstrap.renderModal instead, which will ensure J4 compatibility.


<button type="button" data-toggle="modal" data-target="#contactModal">Contact Us</button>


use Joomla\CMS\HTML\HTMLHelper;

echo HTMLHelper::_(
        'url'        => 'contact-us.html',
        'title'      => 'Contact Us',
        'backdrop'   => 'static',
        'modalWidth' => 40,
        'bodyHeight' => 60,
        'footer'     => '<a type="button" class="btn btn-secondary" data-dismiss="modal">Close</a>'

Note that 'backdrop' => 'static', will prevent the modal closing when clicking the background.

  • I'm using Joomla 3.9.x, how to do it in Joomla 3.9?
    – zhang
    Commented Nov 16, 2020 at 5:09
  • The above is for Joomla 3.9
    – Lodder
    Commented Nov 16, 2020 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.