ColorBox是一个基用jQuery开发,可定制的Lightbox控件。可以通过CSS改变内容展示框。ColorBox支持单张图片,图片组,Ajax HTML,Inline HTML,Flash/Video,Iframed等内容。
相似功能的JQ插件还有fancybox
图片展示:
示例代码展示
// Examples:
// Image links displayed as a group
$('a.gallery').colorbox({rel:'gal'});
// Ajax
$('a#login').colorbox();
// Called directly, without assignment to an element:
$.colorbox({href:"thankyou.html"});
// Called directly with HTML
$.colorbox({html:"<h1>Welcome</h1>"});
// ColorBox can accept a function in place of a static value:
$("a.gallery").colorbox({rel: 'gal', title: function(){
var url = $(this).attr('href');
return '<a href="' + url + '" target="_blank">Open In New Window</a>';
}});
主页:http://colorpowered.com/colorbox/
