3

I'm trying to work with fancybox 1.3.4. All it's doing is giving me an error.

Error:

d.onCleanup is not a function

If the error doesn't come, just open the image in a new tab. I followed the examples on the homepage as much as I could.

Code:

HTML:

<a class="grouped_elements" rel="ppt1" href="/static/images/bermuda/powerpoint/1_b.jpg"><img src="/static/images/bermuda/powerpoint/1_b.jpg" /></a>
<a class="grouped_elements" rel="ppt1"><img src="/static/images/bermuda/powerpoint/2_b.jpg" /></a>
<a class="grouped_elements" rel="ppt1"><img src="/static/images/bermuda/powerpoint/3_b.jpg" /></a>
<a class="grouped_elements" rel="ppt1"><img src="/static/images/bermuda/powerpoint/4_b.jpg" /></a>
<a class="grouped_elements" rel="ppt1"><img src="/static/images/bermuda/powerpoint/5_b.jpg" /></a>

Jquery: masterpage: <script type="text/javascript" src="/static/js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>

aspx: this is in the top. <link rel="stylesheet" href="/static/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />

This is in my document.ready $('a.grouped_elements').fancybox();

Yes I did notice only the first <a> has the href attribute but it's just for testing.

Edit:

It doesn't open in a new tab it just goes to that image(so a blank page with that image) and when I return to the page with all pictures on it the click won't work at all.

Teun Pronk
  • 1,367
  • 12
  • 24
  • Are you also including the jquery core? This is required in addition to the fancybox...js include. – jeffknupp Dec 30 '11 at 11:49
  • yes I am. Thought it was kinda obvious thats why I didnt paste it into the question ;) – Teun Pronk Dec 30 '11 at 11:51
  • 1
    are you using drupal? http://stackoverflow.com/questions/4468348/fancybox-d-oncleanup-is-not-a-function – kaz Dec 30 '11 at 12:08
  • I have no idea what drupal is but the link has helped. to bad I cant accept it as answer :( Problem solved, it had to do with the css link. – Teun Pronk Dec 30 '11 at 12:15

1 Answers1

2

So the answer is:

it's the problem with CSS. After you changed link to CSS it seems to be fixed.

btw. very strange problem :/ i don't understand how it could be related

kaz
  • 1,943
  • 1
  • 13
  • 19
  • Well it I just made a typo in the destination path of the CSS file. Your link made me check my link twice so I found the typo ;) – Teun Pronk Dec 30 '11 at 12:39
  • Wow, it's so weird that this was the problem. Why would lack of CSS cause JS to fail? – Ryan Mar 27 '14 at 20:16