Javascript 图片库无法正常工作

发布于 2024-07-29 23:28:29 字数 943 浏览 6 评论 0原文

我在创建的 WordPress 网站中使用了名为 prettyPhoto.js 的图片库引擎。 然而,由于某种奇怪的原因,图像库似乎完全停止工作,我一生都无法找到如何纠正这个问题(没有明确地浏览整个网站并删除 rel=" Prettyphoto" 标签嵌入在所有图像锚链接中。

我想知道 javascript 或 CSS 是否没有正确输出到浏览器,但看看 firebug 中的“Net”面板,似乎是我尝试查看引用要打开的图像的 链接,它们都具有所需的“prettyPhoto”属性。

有问题的页面是 <。 a href="http://instant-wine-cellar.co.uk/products/microcellar/" rel="nofollow noreferrer"> http://instant-wine-cellar.co.uk/products/ Microcellar 并尝试单击任何一个 Microcellar 图片。

另一个是首页上的“观看微蜂窝视频”链接。

对于那些不知道的人。 这个图片库脚本与许多其他脚本一样,由以下人员工作:
1. 将 PrettyPhoto javascript 文件放入您的服务器中。
2. 将 PrettyPhoto CSS 文件放入您的服务器中。
3. 将上述文件的路径引用到 html 文件的页眉(或页脚)中。
4. 通过将一些定制脚本放入 HTML 文件中来触发该过程,以查找文件中具有特定 rel 属性的 标记,并打开它引用的链接,进入 PrettyPhoto 模态框。

I used a image gallery engine called prettyPhoto.js in a WordPress site that I was creating. However, for some strange reason the image gallery seems to have completely stopped working and I can't for the life of me find out how to rectify this problem (without explicitly going through the entire site and stripping out the rel="prettyphoto" tags embedded in all the image anchor links.

I am wondering if the javascript or the CSS is not being output to the browser properly, but taking a look at the "Net" panel in firebug, it seems to be loading these files without a problem. I tried having a look at the <a> link referencing the images to be opened, and they all had the required "prettyPhoto" attribute.

The page in question is
http://instant-wine-cellar.co.uk/products/microcellar and try clicking on any of the microcellar pictures.

Another is the "Watch Microcellar Video" link on the front page.

For those who do not know. This image gallery script, same with a lot of others, works by:
1. putting the prettyPhoto javascript file in your server.
2. putting the prettyPhoto css file in your server.
3. referencing the path to the above files into the head (or footer) of your html file.
4. triggering the process by putting some bespoke script into your HTML file to find the <a> tags in your file with a certain rel attribute and opening the link it references, into the prettyPhoto modal box.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初相遇 2024-08-05 23:28:31

首先包含 jquery.js 然后是插件。
查找:

<script src="http://instant-wine-cellar.co.uk/wp-content/themes/Wineconcepts/js/jquery.prettyPhoto.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>

替换:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="http://instant-wine-cellar.co.uk/wp-content/themes/Wineconcepts/js/jquery.prettyPhoto.js" type="text/javascript"></script>

At first include jquery.js then plugin.
Find:

<script src="http://instant-wine-cellar.co.uk/wp-content/themes/Wineconcepts/js/jquery.prettyPhoto.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>

Replace:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="http://instant-wine-cellar.co.uk/wp-content/themes/Wineconcepts/js/jquery.prettyPhoto.js" type="text/javascript"></script>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文