我一直在尝试使用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>

最佳答案

尝试

的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>


Java脚本

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

关于javascript - Litebox插件不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24637393/

10-09 04:19