0
我在colorbox modalpopup的頂部創建一個插件。使用colorbox和jquery插件分組圖像
jQuery插件
$(document).ready(function(){
(function($) {
$.fn.pop= function(options) {
var options = $.extend({}, $.fn.pop.defaults, options);
return this.each(function() {
var o = options;
var obj = $(this);
obj.click(function() {
obj.colorbox({height:o.h, width:o.w , iframe:true});
});
});
};
$.fn.pop.defaults = {
h: '60%',
w: '60%'
};
})(jQuery);
});
在用戶層面,我只是讓他們打電話給 $ POP()( 「類名」)。 //如果他們需要優化長度寬度,他們只是給予編號
現在我的問題是,如果我需要組圖像,我必須做這樣的事情。
$("a[rel='example1']").colorbox();
insted的這個我需要調用我的函數
$("a[rel='example1']").pop();
但它沒有羣體本身。 anyhelp可以理解