FancyBox - 图片下方的多个自定义按钮

时间:2013-12-24 15:54:57

标签: javascript html fancybox

我正在尝试在我的fancybox图库中的图片下方并排添加几个按钮(即下载,打印,电子邮件等)。但是,我似乎只能输出一个盒子。我对fancybox很新,我已经阅读了几个问题/主题,所以你能提供任何帮助都会受到赞赏。

此处代码:http://jsfiddle.net/vrbas/tSvGG/

<div class="download">
      <a class="fancy-media" data-title-id="title-1" rel="gallery" href=
      "http://www.iiacanadanationalconference.com/wp-content/uploads/2013/01/test.jpg">
      <img width="100" height="126" border="0" src=
      "http://www.iiacanadanationalconference.com/wp-content/uploads/2013/01/test.jpg"
      alt="" />
      <br />
      Some Title</a>
        <div id="title-1" class="hidden">
            <a href="http://www.education.gov.yk.ca/pdf/pdf-test.pdf">DOWNLOAD</a>
        </div>
</div>

    <script type="text/javascript">
        $(document).ready(function() {
            $(".fancy-media").fancybox({
                openEffect  : 'none',
                closeEffect : 'none',
                beforeLoad: function () {

                    var el, id = $(this.element).data('title-id');

                    if (id) {
                        el = $('#' + id);

                        if (el.length) {
                            this.title = el.html();
                        }
                    }
                }
            });
        });
    </script>

0 个答案:

没有答案