FancyBox分组元素出错(无法加载请求的内容)

时间:2012-01-20 14:13:49

标签: javascript jquery html fancybox twitter-bootstrap

我正在尝试用fancybox做一个图像组(我也使用twitter bootstrap等)

但是当出现FancyBox“弹出窗口”时,我收到以下错误:

The requested content cannot be loaded.
Please try again later.

这是一个反映我的问题的测试用例:

<!DOCTYPE HTML>

<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>Test</title>
        <link href="scripts/fancybox/jquery.fancybox-1.3.4.css" rel="stylesheet "type="text/css" media="screen"/> 
    </head>
    <body>
        <ul>
            <li>
                <a class="grouped_elements" rel="group1" href="#">
                    <img class="thumbnail" src="http://placehold.it/90x90" alt>
                </a>
            </li>
            <li>
                <a class="grouped_elements" rel="group1" href="#">
                    <img class="thumbnail" src="http://placehold.it/90x90" alt>
                </a>
            </li>
            <li>
                <a class="grouped_elements" rel="group1" href="#">
                    <img class="thumbnail" src="http://placehold.it/90x90" alt>
                </a>
            </li>
        </ul>
        <script type="text/javascript" charset="utf-8" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        <script type="text/javascript" charset="utf-8" src="scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
        <script type="text/javascript" charset="utf-8">
            $(document).ready(function(){
                    $(".thumbnail").click(function(){
                        $("a.grouped_elements").fancybox();
                        });
                    });
        </script>
    </body>
</html>

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

尝试将HREF设置为如下图片:

        <a class="grouped_elements" rel="group1" href="http://placehold.it/90x90_BIG.jpg"">
            <img class="thumbnail" src="http://placehold.it/90x90" alt>
        </a>