在图像轮播中的每个图像上的文本

时间:2015-07-08 11:04:14

标签: jquery html css carousel

我想更改图片轮播中每张图片上的文字。我尝试为每张图片使用单独的<div>,但它仍然无效。 这是图像轮播的类型:Space Gallery 源代码可用。我无法按要求实施。任何有可能解决方案的人?

<div id="myGallery" class="spacegallery">
                <div>
                <img src="images/bw3.jpg" alt="" />
<!--This is my text that i want to put-->
                <p class="gh"><strong>Here</strong></p>
                </div>
                <img src="images/lights3.jpg" alt="" />
                <img src="images/bw2.jpg" alt="" />
                <img src="images/lights2.jpg" alt="" />
                <img src="images/bw1.jpg" alt="" />
                <img src="images/lights1.jpg" alt="" />
            </div>

我甚至试过这个:

<div id="myGallery" class="spacegallery">
                    <div>
                    <img src="images/bw3.jpg" alt="" />
                  <span>  <marquee behavior="slide" direction="left">HTML slide-in text...</marquee></span>

                    </div>
                    <div>
                    <img src="images/lights3.jpg" alt="" />
                    <span><br/>Tadad</span>
                    </div>
                    <img src="images/bw2.jpg" alt="" />
                    <img src="images/lights2.jpg" alt="" />
                    <img src="images/bw1.jpg" alt="" />
                    <img src="images/lights1.jpg" alt="" />
                </div>
            </div>

的CSS:

span{
    position:absolute;
    z-index:1;
    top:100px;
    left:30%;
}

The Result for the other code with<code><marquee></code>tag

3 个答案:

答案 0 :(得分:1)

您需要使用另一个图库来实现自定义块支持。如果您查看SpaceGallery的代码 - 可直接搜索或元素。

一种可能的解决方案是创建javascript函数并使after回调(spaceGallery支持此功能)来创建和定位文本。

答案 1 :(得分:1)

Follow below url may be help.
    http://jsfiddle.net/technotarek/gXN2u/

答案 2 :(得分:0)

Spacegallery插件无法实现。你必须使用另一个插件。

或者有一件事可以添加到图像本身