无法让 FancyBox 工作
起初,fancybox 工作正常。但当我添加到该网站时,它完全失败了,我不知道哪里出了问题。
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
</script>
<script type="text/javascript" src="js/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript">
$(document).ready(function() {
$(".fancyImg").fancybox();
});
</script>
<div id="About-MichaelP"><p>Website made by: <a class="fancyImg" href="#MichaelP">Michael Podsiadly</a></p></div>
<div style="display: none;">
<div id="MichaelP" class="Hide">
<h1>About Michael Podsiadly</h1>
<p></p>
</div>
</div>
先感谢您。这让我很累,我什至无法正常思考。
Well at first, fancybox worked. But then when I added on to the site, it completely failed and I have no clue where I went wrong.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
</script>
<script type="text/javascript" src="js/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript">
$(document).ready(function() {
$(".fancyImg").fancybox();
});
</script>
<div id="About-MichaelP"><p>Website made by: <a class="fancyImg" href="#MichaelP">Michael Podsiadly</a></p></div>
<div style="display: none;">
<div id="MichaelP" class="Hide">
<h1>About Michael Podsiadly</h1>
<p></p>
</div>
</div>
Thank you in advance. And this has been getting me so tired, I can't even think straight anymore.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嘿,看来您还没有设置锚标记的类别,
它指的是具有“组”类别的锚标记。
尝试将组类添加到您的链接中:
或者
您可能尝试两次包含 jQuery 库。这可能会导致错误。
或者
我经常这样做:可能是文件位于错误的位置。是否有“js”文件夹?文件真的在那里吗? CSS 文件是否正确附加? CSS 中引用的图像是相对于 html 文件还是 CSS 而言的?回答这些问题的最佳方法是在 Firefox 中打开源代码并点击 js 和 css 文件的链接......
Hey it looks like you haven't set the class of the anchor tags
is referring to anchor tags with a class of "group".
Try adding the group class to your links:
OR
It could be that you're trying to include the jQuery library twice. That could cause errors.
OR
I do this one a lot: It could be that the files are in the wrong place. Is there a "js" folder? Are the files actually in there. Is the CSS file attached properly? Are the images referenced in the CSS relative to the html file or the CSS? The best way to answer these question is open up the source in Firefox and follow the links to the js and css files...