简体   繁体   English

受Javascript for EasySlider 1.7影响的CSS

[英]CSS affected by Javascript for EasySlider 1.7

I'm trying to get a nice overlay effect going with a slider using EasySlider 1.7. 我正在尝试使用EasySlider 1.7获得一个很好的叠加效果。 Not only should this include images, but also text that represents the image. 这不仅包括图像,还包括代表图像的文本。 Now I'm having trouble lining up the text on the page where I need it. 现在我无法在我需要的页面上排列文本。

http://intranet.streamflame.com http://intranet.streamflame.com

That is the home page, The section where you see the black overlay on the main scrolling image is where the text is supposed to sit. 这是主页,您在主滚动图像上看到黑色叠加层的部分是文本应该放置的位置。 Now if I get rid of the code to scroll the text, the text sits where it is supposed to. 现在,如果我摆脱滚动文本的代码,文本就会停留在应该的位置。 However as soon as I add the script to scroll the text at the same time, it seems to make the text disappear. 但是,只要我添加脚本同时滚动文本,它似乎会使文本消失。

Here's my Code. 这是我的代码。
HTML: HTML:

<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: CSS:

.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: EasySlider 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>

Note: I have tried putting the script for the text under the script for the image, this has no change to the look of it. 注意:我已经尝试将文本的脚本放在图像的脚本下,这看起来没有变化。
Hoping someone can help. 希望有人可以提供帮助。

Adding slider effect to filler text sets its properties to by jquery 将滑块效果添加到填充文本会通过jquery将其属性设置为

It is the result of your li inside the filler-text not taking its height. 这是你的填充文本里面的li没有达到它的高度的结果。 so first solution is to make the li take its height by adding clearfix in advance mode or simple: 所以第一个解决方案是通过在预先模式或简单中添加clearfix来使li达到其高度:

<div style="clear: both;"></div>

after each 每次之后

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

So it looks like: 所以它看起来像:

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

And finally manage the top position of your filler-text 最后管理填充文本的顶部位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM