Cheerio
Cheerio

Reputation: 1240

Error with jQuery (in IE8)

I get an error when I use:

$(document).ready(function() {
    $("#single_image").fancybox();
})

the error is: object doesn't support this property or method

I tried to remove the ; but I still get the error!

I'm using this plugin: http://fancybox.net/

Upvotes: 1

Views: 1843

Answers (3)

Jack
Jack

Reputation: 11

Fixed: I was having the same problem using fancybox,

When I added parameter 'type': 'iframe' it started working fine in IE

Although after adding this, the it stopped autoresizing, you can work around by adding 'height' and 'width' parameters.

HTH, Jack.

Upvotes: 1

nathanvda
nathanvda

Reputation: 50057

The error given indicates that the fancybox is not known, this seems to suggest it did not load the fancybox-js file.

If this works in other browsers, i am a bit baffled as to why that could be.

[EDIT: after further googling] Apparently this is a known problem: which version of fancybox/jquery are you using? You need to be using at least version 1.4.2 of jquery in conjunction with version 1.3.1 of fancybox.

This might be old, since jquery is now at 1.5.1 and fancybox 1.3.4 But maybe this is something to investigate further: a mismatch in versions?

Upvotes: 1

Kevin Stubbs
Kevin Stubbs

Reputation: 323

When you import the Fancybox JQuery plugin you must use './' like this:

<script type="text/javascript" src="./fancybox/jquery.fancybox-1.3.4.pack.js"></script> <link rel="stylesheet" href="./fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />

Upvotes: -1

Related Questions