Image Caption

Wednesday, February 15, 2012

Thickbox or Lightbox in Joomla

Step :1

Add the below line in your template index.php

<?php
$params = array('size'=>array('x'=>500, 'y'=>500));
JHTML::_('behavior.modal', 'a.mymodal', $params);
?>

Step :2

Add the below html code to any where of your [module, articles, template...]

<a class="mymodal" title="example"
href="http://rselvakumar.blogspot.com"
rel="{handler: \'iframe\',
size: {x: 500, y: 550}}">Example Modal Window</a>'


Full Code:
<?php
// prepare the JavaScript parameters
$params = array('size'=>array('x'=>500, 'y'=>500));
// add the JavaScript
JHTML::_('behavior.modal', 'a.mymodal', $params);
// create the modal window link
echo '<a class="mymodal" title="example"
href="http://rselvakumar.blogspot.com"
rel="{handler: \'iframe\',
size: {x: 500, y: 550}}">Example Modal Window</a>';
?>

No comments: