Wednesday, July 01, 2009

Lightbox Modal Effect

-in your scripts.js goes:

SqueezeBox.initialize({});
$$('a.lightbox').each(function(el) {
el.addEvent('click', function(e) {
new Event(e).stop();
SqueezeBox.fromElement(el);
});
});
OR if no domready

window.addEvent('domready', function() {
SqueezeBox.initialize({});
$$('a.lightbox').each(function(el) {
el.addEvent('click', function(e) {
new Event(e).stop();
SqueezeBox.fromElement(el);
});
});
});



-in template your index.php, to call Joomla's Mootool engine...before html goes:

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

-In article ADD class="lightbox" example:

NOTE Replace [ ] with <>

[a class="lightbox" href="images/stories/image.jpg"][img class="noborder" src="images/stories/small_image.jpg" border="0" alt="Image" /][/a]