jQuery FancyBox 2.0:助手问题(按钮和拇指)

发布于 2024-12-17 07:14:46 字数 948 浏览 3 评论 0原文

尽管完全遵循了 fancybox 新版本 2 的指南,但我无法激活助手。我不明白我哪里错了。

有我当前的代码:

HTML:

<div id="disegni" style="display: none">
   <div class="title">Disegni</div>
   <p>&nbsp;</p>
   <a class="fancybox-button" rel="fancybox-button" title="Scultura 1 disegni" href="images/intro/01.jpg"><img src="images/intro/01small.jpg" alt=""/></a>
   <a class="fancybox-button" rel="fancybox-button" title="Scultura 2 disegni" href="images/intro/02.jpg"><img src="images/intro/02small.jpg" alt=""/></a>
</div>

Javascript:

$(".fancybox-button").fancybox({
   openEffect   : 'elastic',
   closeEffect  : 'fade',
   revealEffect: 'none',
   hideEffect   : 'none',
   prevEasing  : 'swing',
   nextEasing  : 'swing',
   helpers  : { 
  title : { 
         type : 'inside' //inside/outside
      }, 
      buttons   : {}
   }
});

Despite having followed exactly the guide of the new version 2 of fancybox, I wasn't able to activate helpers. I don't understand where I went wrong.

There is my current code:

HTML:

<div id="disegni" style="display: none">
   <div class="title">Disegni</div>
   <p> </p>
   <a class="fancybox-button" rel="fancybox-button" title="Scultura 1 disegni" href="images/intro/01.jpg"><img src="images/intro/01small.jpg" alt=""/></a>
   <a class="fancybox-button" rel="fancybox-button" title="Scultura 2 disegni" href="images/intro/02.jpg"><img src="images/intro/02small.jpg" alt=""/></a>
</div>

Javascript:

$(".fancybox-button").fancybox({
   openEffect   : 'elastic',
   closeEffect  : 'fade',
   revealEffect: 'none',
   hideEffect   : 'none',
   prevEasing  : 'swing',
   nextEasing  : 'swing',
   helpers  : { 
  title : { 
         type : 'inside' //inside/outside
      }, 
      buttons   : {}
   }
});

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

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

发布评论

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

评论(1

记忆で 2024-12-24 07:14:46

你必须包含 js 和 css 文件:

<!-- Add fancyBox - button helper -->
<link rel="stylesheet" type="text/css" href="/js/fancybox/jquery.fancybox-buttons.css" />
<script type="text/javascript" src="/js/fancybox/jquery.fancybox-buttons.js"></script>

它应该可以工作。不确定为什么您在隐藏元素中添加了链接,但也许您必须这样做。

You have to include js and css files:

<!-- Add fancyBox - button helper -->
<link rel="stylesheet" type="text/css" href="/js/fancybox/jquery.fancybox-buttons.css" />
<script type="text/javascript" src="/js/fancybox/jquery.fancybox-buttons.js"></script>

And it should work. Not sure why you added links inside hidden element, but maybe you have to.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文