How to use modal windows in Joomla! ?

Firstly you need write in the View file:

JHTML::_( 'behavior.modal' ); 

After you need write html a link with special params:

  • class=”modal”
  • rel=”{handler: “iframe”, size: {x: 500, y: 500}, onClose: function() {}}”

Example ↓

<a class="modal" rel="{handler: "iframe", size: {x: 500, y: 500}, onClose: function() {}}" href="http://blog.tormix.com" title="">
Modal link text
</a>