首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >受EasySlider 1.7 Javascript影响的CSS

受EasySlider 1.7 Javascript影响的CSS
EN

Stack Overflow用户
提问于 2010-07-09 09:05:28
回答 1查看 1K关注 0票数 4

我试图得到一个很好的覆盖效果与滑块使用EasySlider 1.7。这不仅应该包括图像,还应该包括表示图像的文本。现在,在我需要的页面上,我很难把文字排成一行。

http://intranet.streamflame.com

这是主页,在主滚动图像上看到黑色覆盖的部分是文本应该放在的位置。现在,如果我去掉了滚动文本的代码,文本就会位于它应该的位置。但是,当我添加脚本同时滚动文本时,它似乎会使文本消失。

这是我的密码。

HTML:

代码语言:javascript
复制
<div class="filler">
   <div class="filler-picture">
   <div class="filler-img">
   <ul>{% for project in rotations %}
        <li><img src="{% thumbnail project.key_image.get_absolute_url 559x361 crop,upscale %}" width="559" height="361" alt="{{ project.title }}" /></li>
     {% endfor %}
 </ul>
</div>
<div class="filler-mask">
 <img src="{{ MEDIA_URL }}img/filler.png"  alt="filler" />
</div>
<div class="filler-text">
 <ul>
 <li>
  <span class="filler-text-left">WaterTiger</span>
     <span class="filler-text-right">Project watertiger is a test project whilst we get all the site together, call it a filler if you must, there is no project watertiger your only dreaming.</span>
 </li>
 <li>
  <span class="filler-text-left">Dragonfly</span>
     <span class="filler-text-right">Project Dragonfly is a test project whilst we get all the site together, call it a filler if you must, there is no project dragonfly your only dreaming.</span>
 </li>
 <li>
  <span class="filler-text-left">Spacemunch</span>
     <span class="filler-text-right">Project Spacemunch is a test project whilst we get all the site together, call it a filler if you must, there is no project Spacemunch your only dreaming.</span>
 </li>
</ul>

CSS:

代码语言:javascript
复制
.filler {

     position: relative;
      margin-left:20px;
      height:361px;
      width:559px;
      float:left;

}

.filler-mask {
    position: absolute;
    left:0; top:0;
    height:361px;
    width:559px;
    z-index: 100;
}

.filler-img{
    position: absolute;
    left:0; top:0;
    height:361px;
    width:559px;
    z-index: 50;

}

.filler-text {

      width: 558px;
      height: 68px;
      position: absolute;
      z-index: 200;
      color: #fff;

}

.filler-text li {

      list-style-type: none;
      z-index: 1000;

}

.filler-text-left {

      width: 169px;
      float: left;
      height: 48px;
      padding: 10px;
      font-size: 18pt;
      font-weight: 100;

}
.filler-text-right {

          width: 340px;
      float: right;
      height: 48px;
      padding: 10px;
      font-size: 10pt;
}

EasySlider Javascript:

代码语言:javascript
复制
<script type="text/javascript">
       $(document).ready(function(){ 
        $(".filler-text").easySlider({
         auto: true,
         continuous: true,
         speed: 1800,
         pause: 5000,
         nextId: "next2",
         prevId: "prev2"
        });
        $(".filler-img").easySlider({
         auto: true,
         continuous: true,
         speed: 1800,
         pause: 5000,
         nextId: "next2",
         prevId: "prev2"
        });

       });
</script>

注意:我已经尝试过将文本的脚本放在图像的脚本下面,这不会改变它的外观。

希望有人能帮忙。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-07-13 05:20:20

将滑块效应添加到填充文本中,通过jquery将属性设置为

这是由于你的李内填充-文字没有采取它的高度。因此,第一个解决方案是,通过在预先模式或简单的模式中添加clearfix,使li获得它的高度:

代码语言:javascript
复制
<div style="clear: both;"></div>

在每个之后

代码语言:javascript
复制
<span class="filler-text-left">WaterTiger</span>
<span class="filler-text-right">Project watertiger is a test project whilst we get all the site together, call it a filler if you must, there is no project watertiger your only dreaming.</span>

所以看起来:

代码语言:javascript
复制
<span class="filler-text-left">WaterTiger</span>
<span class="filler-text-right">Project watertiger is a test project whilst we get all the site together, call it a filler if you must, there is no project watertiger your only dreaming.</span>
<div style="clear: both;"></div>

最后,管理填充文本的顶部位置。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3211235

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档