Wayne Smallman
Wayne Smallman

Reputation: 1720

FancyBox 2.1.5 not working with jQuery 1.10

I've just made the update to FancyBox 2.1.5 and jQuery 1.10, but since then FancyBox has stopped working, where each link reverts to its default behaviour.

I don't have any errors or warnings, it just doesn't work. I've tried: 1. different DOCTYPE; 2. different HMTL tag attributes; 3. declaring FancyBox inside and outside the header tag; 4. declaring the code for the FancyBox function inside and outside the header tag; 5. reducing the code down to the simplest practical state; 6. changing the class names; 7. using earlier versions of jQuery; 8. removing all parameters from the FancyBox function; 9. a multitude of combinations of 1-8.

Everything I've tried has failed.

Also, the demo works perfectly, though I cannot replicate it in my application.

Note: I CANNOT tame the list above to appear as anything even approaching sensible; it either appears as just 1 item or 8, even though there's 9 items.

Upvotes: 1

Views: 4319

Answers (1)

Wayne Smallman
Wayne Smallman

Reputation: 1720

Having scoured my application, I've discovered a working example, and it appears FancyBox is enforcing a strict usage policy, as it only works if there's a type attribute for the function:

$(document).ready(function() {
    $("a.iframe").fancybox({
        'hideOnContentClick': true,
        'height': 380,
        'padding': 0,
        'width': 700, 
        'type': 'iframe'
    });
});

Upvotes: 4

Related Questions