Litebox插件不起作用

时间:2014-07-08 16:48:14

标签: javascript jquery html asp.net jquery-plugins

我一直在尝试使用litebox插件创建一个用于弹出效果的图库。该网站是一个包含单个母版页的aspx网站。 母版页中的链接:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js" type="text/javascript"></script>
<script src="assets/javascript/jquery.slides.js" type="text/javascript"></script>
<script src="assets/javascript/jquery.slides.min.js" type="text/javascript"></script>

<!--Litebox start-->
<link href="assets/litebox/css/litebox.css" rel="stylesheet" type="text/css" />
<link href="assets/litebox/css/litebox.css" rel="stylesheet" type="text/css" />
<link href="assets/litebox/css/normalize.css" rel="stylesheet" type="text/css" />
<script src="assets/litebox/js/smoothscroll.js" type="text/javascript"></script>
<script src="assets/litebox/js/images-loaded.min.js" type="text/javascript"></script>
<script src="assets/litebox/js/litebox.js" type="text/javascript"></script>
<script src="assets/litebox/js/backbone.js" type="text/javascript"></script>

弹出图片:

<p>
<a href="assets/images/portfolio/customizingQuestions.jpg" target="_self" class="inline-block litebox" data-litebox-group="group-1" ><img src="assets/images/portfolio/customizingQuestionsThumb.jpg" class="inline-block" /></a>
                <a href="assets/images/portfolio/differentQuestionTypes.jpg" target="_self" class="inline-block litebox" data-litebox-group="group-1"><img src="assets/images/portfolio/differentQuestionTypesThumb.jpg" class="inline-block" /></a>
                <a href="assets/images/portfolio/finalMoments.jpg" target="_self" class="inline-block litebox" data-litebox-group="group-1"><img src="assets/images/portfolio/finalMomentsThumb.jpg" class="inline-block" /></a>
                <a href="assets/images/portfolio/pressingAButton.jpg" target="_self" class="inline-block litebox" data-litebox-group="group-1"><img src="assets/images/portfolio/pressingAButtonThumb.jpg" class="inline-block" /></a>
                <a href="assets/images/portfolio/welcomeScreen.jpg" target="_self" class="inline-block litebox" data-litebox-group="group-1"><img src="assets/images/portfolio/welcomeScreenThumb.jpg" class="inline-block" /></a>
            </p>

1 个答案:

答案 0 :(得分:1)

尝试

HTML

<div id="gallery">
       <ul>
           <li><a href="photos/image1.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery').lightBox();">
               <img src="photos/thumb_image1.jpg" width="72" height="72" alt="" />
           </a></li>
           <li><a href="photos/image2.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery a').lightBox();">
               <img src="photos/thumb_image2.jpg" width="72" height="72" alt="" />
           </a></li>
           <li><a href="photos/image3.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery a').lightBox();">
               <img src="photos/thumb_image3.jpg" width="72" height="72" alt="" />
           </a></li>
           <li><a href="photos/image4.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery a').lightBox();">
               <img src="photos/thumb_image4.jpg" width="72" height="72" alt="" />
           </a></li>
           <li><a href="photos/image5.jpg" title="Utilize a flexibilidade dos seletores da jQuery e crie um grupo de imagens como desejar. $('#gallery a').lightBox();">
               <img src="photos/thumb_image5.jpg" width="72" height="72" alt="" />
           </a></li>
       </ul>
   </div>

的Javascript

<script type="text/javascript">
        $(function () {
            $('#gallery a').lightBox();
        });
</script>