Access our premium support and let us know your problems, we will help you solve them.

0
No products in the cart.

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Triggering FancyBox with click() event #10126
    blankjfk
    Participant

    One of the easiest ways to do it is using the special data-fancybox attributes in your <div> tag like :

    <div id="eAcon6LPgHo" class="youtube_box" data-fancybox-href="http://www.youtube.com/embed/eAcon6LPgHo?autoplay=1" data-fancybox-type="iframe">
        <img src="http://img.youtube.com/vi/eAcon6LPgHo/0.jpg"/>
        <span class="caption">
            <h3>Dan Bull Raps Fast</h3>
        </span><!--/.caption-->
    </div><!--/.youtube_box-->
    

    Then you can use the usual fancybox initialization script :

    jQuery(document).ready(function ($) {
        $('.youtube_box').fancybox();
    }); // ready
    

    No need to use the .click() method.

    See JSFIDDLE

    in reply to: how to use fancybox #10140
    blankjfk
    Participant

    you can bind fancybox to all elements with the same rel attribute (and without having any class) like

    $("a[rel=hotel_img]").fancybox();
    

    See JSFIDDLE


    EDIT :

    You could also group elements with different rel attributes within the same fancybox initialization script like :

    $("a[rel=hotel_img], a[rel=standart_room_img], a[rel=agents_room_img]").fancybox();
    

    See updated JSFIDDLE

Viewing 2 posts - 1 through 2 (of 2 total)