Simple lightbox using Jquery UI dialog widget:
function LightBox(imgSrc, imgTitle)
{
var img = $('<img />');
$('body').append(img);
img.attr('src', imgSrc);
img.load(function()
{
var lightBox = $('<div></div>');
lightBox.dialog({ autoOpen: false, height: img.height() + 50, width: img.width() + 50, modal: true, title : imgTitle });
lightBox.html('').append(img);
lightBox.dialog('open');
});
};
No comments:
Post a Comment
Comments are very welcome but are moderated to prevent spam.