是否有从自定义按钮启动 Lightbox 的选项
就像是:
<a class="bttn">START</a>
<div>
<a href="image/path" rel="imgs">img</a>
</div>
JS:
$('.bttn').click(function(){
$.slimbox($('div a'), 2); //2 slimbox startimage;
});
是否有从自定义按钮启动 Lightbox 的选项
就像是:
<a class="bttn">START</a>
<div>
<a href="image/path" rel="imgs">img</a>
</div>
JS:
$('.bttn').click(function(){
$.slimbox($('div a'), 2); //2 slimbox startimage;
});
解决方案:
$('.bttn').click(function(){
var linkMapper = linkMapper || function(el) {
return [el.href, el.title];
};
var linksFilter = linksFilter || function() {
return true;
};
var links = $('.div a');
var length,i = 0,
filteredLinks = $.grep(links, function(el, i) {
return linksFilter.call(el, i);
});
for (length = filteredLinks.length; i < length; ++i){
filteredLinks[i] = linkMapper(filteredLinks[i], i);
}
$.slimbox(filteredLinks, 2); //start position
});