开发者

JS is not loading correctly, where is the fault?

I have a website where I want to use MagicZoom. Everything would be fine since it is easy to implement, but there seems to be an error when loading the js file.

I will send you the website which is currently under construction. MagicZoom should be implemented there, 开发者_如何学JAVAwhere you chose your fabric, for a close-up.

I think, but of course this is only my opinion and I'm not an expert, that the problem occurs because the div container with the picture is created dynamically from another PHP file and not present onload. Therefore the JavaScript does not work properly.

You will see that in the second step the zoom does not load although the class is set correctly.


Your error says "prettyPhoto is not a function". This tells me that some script is trying to use the "prettyPhoto" object before that script has been included on the page.

Looking at your HTML header, I see that is among the last of the <script> tags. Try moving the <script> tag where you include that library in your HTML header up a couple of lines, above some of the other includes. Be aware - you can't move it above the includes for jQuery!

Try that out, let us know.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜