问题描述:

I gave up on fancybox as it was not practical so I have opted for lightbox. but I have a question does lightbox support triggering the gallery thing from a button and not clicking on an image? if it does can someone point me in the right direction?

Thanks

网友答案:

Add a rel="lightbox" attribute to any link tag to activate the lightbox, lightbox can be used with several different combinations of triggers that activates the lightbox. Se example below.

<a href="images/image-1.jpg" rel="lightbox" title="caption"> text/image/etc... </a>
网友答案:

I am not sure if lightbox supports it. Perhaps not. For that reason i went for jquery slimbox in my project and i call it like this on a link click:

    el.children("img").bind("click", function(){
        jQuery("#GArticlesContainer a:has(img)").slimbox();
    });

el beeing in another elment not the one thats beeing clicked. It binds GArticledcontained links that have image to open them with slimbox. You could do the same with button i guess.

If you want to see more of how it works then go check: http://www.sanlab.ee/gallery/

If you want to open picture on link click, not just add jquery event to a new image, likein the case of sanlab, you can do that:

jQuery.slimbox(url, description, options);

Check out slimbox api about it: http://code.google.com/p/slimbox/wiki/jQueryAPI

Hope, that answers your question.

Alan.

相关阅读:
Top