【问题标题】:Description div overlay not showing on li image说明 div 覆盖未显示在 li 图像上
【发布时间】:2013-01-10 23:33:01
【问题描述】:

我正在使用滑块 http://marktyrrell.com/labs/blueberry/ 并尝试添加描述框来覆盖图像并随每个 div 变化。我添加了一个 div 类,但它没有显示出来。不确定我是否还需要更改 javascript?

css

.blueberry { 
    margin: 0 auto; 
    max-width:1280px; 
    position:relative; 
    z-index:1;  
    margin-top:-25px; 

}

.blueberry .slides {
    display: block;
    position: relative;
    overflow: hidden;
    margin:0;
    padding:0;
    list-style:none;

}
.blueberry .slides li {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;

}
.blueberry .slides li img {
    display: block;
    width: 100%;
    max-width: none;

}
.blueberry .slides li.active { display: block; position: relative; }
.blueberry .crop li img { width: auto; }

.slides .description {
    z-index:100;
    position:absolute;
    left: 0px;
    background:#000;
    color:#1d1d1d;
}

HTML

<div class="blueberry shadow">
  <ul class="slides"> 
  <li><img src="images/slide1.jpg" />
  <div class="description">
  <p>Kick off 2013 by starting a fundraising campaign to help people get access to clean water. It&rsquo;s fun, it&rsquo;s easy and it&rsquo;s the best way we can think to start the new year.</p></div></li>

js

<script>
$(window).load(function() {
$('.blueberry').blueberry();
});
</script>

提前感谢您的帮助

【问题讨论】:

    标签: javascript jquery css slider slideshow


    【解决方案1】:

    您需要定义 css top 属性,看看它工作正常:

    注意:在ul li 中使用divp 是违反网络标准的。我建议使用spanemsi 等标签。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多