【问题标题】:Image gallery with thumnail and two captions带有缩略图和两个标题的图片库
【发布时间】:2014-10-07 09:57:36
【问题描述】:

我需要设计类似于下面示例的具有响应功能的画廊。

到目前为止,我设法找到了几个画廊,但每个画廊都有一个或另一个限制。我正在处理的图库基于 jssor 示例 http://www.jssor.com/demos/image-gallery-with-vertical-thumbnail.html

我可以对代码进行一些修改,使其与我的要求相似,不幸的是,在我的本地系统上运行的相同代码在 JSFiddle 上不起作用。

目前我尝试将标题添加到 jssor 库,但它不起作用,而我的实际要求是两个单独的标题,一个将显示图像的标题,另一个将链接到网站或网页。 ..

我很感激这方面的帮助或与我的要求相似的画廊,我花了两天时间试图获得可以轻松定制为我的设计的好代码。

代码示例:

<div style="width:1000px; background-color:green; margin-top:30px;">
    <!-- Jssor Slider Begin -->
    <!-- You can move inline styles to css file or css block. -->
    <div id="slider1_container" style="position: relative; top: 0px; left: 0px; width: 1000px;  height: 480px; overflow: hidden;">
        <!-- Loading Screen -->
        <div u="loading" style="position: absolute; top: 0px; left: 0px;">
            <div style="filter: alpha(opacity=70); opacity:0.7; position: absolute; display: block; top: 0px; left: 0px;width: 100%;height:100%;"></div>
            <div style="position: absolute; display: block; background: url(../img/loading.gif) no-repeat center center;  top: 0px; left: 0px;width: 100%;height:100%;"></div>
        </div>
        <!-- Slides Container -->
        <div u="slides" style="cursor: move; position: absolute; left:0; top: 0px; width: 550px; height: 480px; overflow: hidden;">
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/01.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-01.jpg" />    <span> Title</span>

            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/02.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-02.jpg" />
            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/03.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-03.jpg" />
            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/04.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-04.jpg" />
            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/05.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-05.jpg" />
            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/06.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-06.jpg" />
            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/07.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-07.jpg" />
            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/08.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-08.jpg" />
            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/09.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-09.jpg" />
            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/10.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-10.jpg" />
            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/11.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-11.jpg" />
            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/12.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-12.jpg" />
            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/13.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-13.jpg" />
            </div>
            <div>
                <img u="image" src="http://www.jssor.com/img/travel/14.jpg" />
                <img u="thumb" src="http://www.jssor.com/img/travel/thumb-14.jpg" />
            </div>
        </div>
        <!-- Arrow Left --> <span u="arrowleft" class="jssora05l" style="width: 40px; height: 40px; top: 140px; left: 10px;">
        </span>

        <!-- Arrow Right --> <span u="arrowright" class="jssora05r" style="width: 40px; height: 40px; top: 140px; left: 490px">
        </span>

        <!-- Arrow Navigator Skin End -->
        <!-- Thumbnail Navigator Skin 02 Begin -->
        <div u="thumbnavigator" class="jssort02" style="position: absolute; width: 430px; height: 480px; right:0px; bottom: 0px; margin-left:2px;">
            <div u="slides" style="cursor: move;" class="thumbnail-custom">
                <div u="prototype" class="p" style="position: absolute; width: 99px; height: 66px; top: 0; left: 0;">
                    <div class=w>
                        <thumbnailtemplate style=" width: 100%; height: 100%; border: none;position:absolute; top: 0; left: 0;"></thumbnailtemplate>
                    </div>
                    <div class=c></div>
                </div>
            </div>
            <!-- Thumbnail Item Skin End -->
        </div>
        <!-- Thumbnail Navigator Skin End -->
    </div>
    <!-- Jssor Slider End -->
</div>

【问题讨论】:

    标签: javascript jquery html css image-gallery


    【解决方案1】:

    请删除脚本第 42 行不需要的“/”。

    并进行以下更改,

    1. 为字幕添加 css

      /* caption css */
      .captionOrange, .captionBlack
      {
          color: #fff;
          font-size: 20px;
          line-height: 30px;
          text-align: center;
          border-radius: 4px;
      }
      .captionOrange
      {
          background: #EB5100;
          background-color: rgba(235, 81, 0, 0.6);
      }
      .captionBlack
      {
          font-size:16px;
          background: #000;
          background-color: rgba(0, 0, 0, 0.4);
      }
      a.captionOrange, A.captionOrange:active, A.captionOrange:visited
      {
          color: #ffffff;
          text-decoration: none;
      }
      a.captionOrange:hover
      {
          color: #eb5100;
          text-decoration: underline;
          background-color: #eeeeee;
          background-color: rgba(238, 238, 238, 0.7);
      }
      
    2. 添加字幕选项

      $CaptionSliderOptions: {
          $Class: $JssorCaptionSlider$,
          $CaptionTransitions: _CaptionTransitions,
          $PlayInMode: 1,
          $PlayOutMode: 3
      }
      
    3. 为幻灯片添加标题

      <div u=caption t="L" du="2000" class="captionOrange" style="position:absolute; left:20px; top: 300px; width:500px; height:30px;"> Caption 1 </div>
      <a u="caption" t="R" class="captionOrange" href="http://www.yourdomain.com" style="position: absolute; top: 300px; left: 630px; width: 250px; height: 30px;">www.yourdomain.com</a>
      

    http://jsfiddle.net/77uuamcn/4/

    【讨论】:

    • 哇!是你,我很幸运......非常感谢你......你有一个很棒的脚本,我希望你能把这个主题添加到你的收藏中。
    • Jssor,由于某种原因,它不显示其他缩略图的标题,我如何在没有任何效果的情况下显示标题,只是淡化效果。我还尝试使用 Caption 类,以便我可以将第二个标题放在第一个标题下,但没有任何效果。
    • 请移除 u=caption 以禁用字幕动画。
    • 见第三步,我为一张幻灯片添加了标题,你可以为其他幻灯片添加标题。
    • 您可以删除 'u="image"' 并通过 css 手动指定小图像尺寸。因此图像尺寸比幻灯片小,然后您有空间将标题放在一边。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-03
    • 1970-01-01
    • 1970-01-01
    • 2011-07-04
    相关资源
    最近更新 更多