如何改变我的卷轴的宽度?

时间:2013-08-22 22:45:18

标签: javascript jquery html css

好的,我已经准备好拿起这台电脑并将它扔进窗户。我有一个水平ul缩略图滑块,用Lightbox打开缩略图。每个缩略图在灯箱中打开一组照片。滑块和灯箱效果都很好,但每个li都是3种不同宽度中的一种。因此,每个li要么相隔很远,要么相互碰撞。

使用CSS将li宽度设置为100px。如果我保持宽度未定义,滑块会折叠并仅显示前几个拇指。

我需要此滑块才能使用100px,145px和175px宽度。有任何想法吗?显然,我不是专家。

以下是滑块的代码:

    <div id="slider1"> <a class="buttons prev" href="#">left</a>
  <div class="viewport">
    <ul class="overview">
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="som106" title="My caption"><img src="img/thumbs/106_t.jpg" /></a><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="som106" title="My caption"></a><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="som106" title="My caption"></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/135_t.jpg" /></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/138_t.jpg" /></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/113_t.jpg" /></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/122_t.jpg"/></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/106_t.jpg" /></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/123_t.jpg"/></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/106_t.jpg" /></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/106_t.jpg" /></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/106_t.jpg" /></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/106_t.jpg" /></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/106_t.jpg" /></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/106_t.jpg" /></a></li>
          <li><a href="file:///S|/Design-Development/CUSTOMER DEVELOPMENT/SOLE OPTIONS/Web files (Johnny)/SO_site/flashIntro/img/image-1.jpg" data-lightbox="image-1" title="My caption"><img src="img/thumbs/106_t.jpg" /></a></li>
        </ul>
  </div>
      <a class="buttons next" href="#">right</a>
</div>

这是CSS

#slider1 {
    height: 100px;
    overflow: hidden;
    margin-top: 20px;
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 10px;
    padding-left: 0;
    display: inline-block;
}
#slider1 .viewport {
    float: left;
    width: 1100px;
    height: 100px;
    overflow: hidden;
    position: relative;
}
#slider1 .buttons {
    background: url("../images/buttons.png") no-repeat scroll 0 0 transparent;
    display: inline-block;
    margin: 30px 10px 0 0;
    background-position: 0 -38px;
    text-indent: -999em;
    float: left;
    width: 39px;
    height: 37px;
    overflow: hidden;
    position: relative;
}
#slider1 .next {
    background-position: 0 0;
    margin: 30px 0 0 10px;
}
#slider1 .disable {
    visibility: hidden;
}
#slider1 .overview {
    list-style: none;
    position: absolute;
    padding: 0;
    margin: 0;
    width: 240px;
left: 0 top: 0;
}
#slider1 .overview li {
    float: left;
    padding: 1px;
    height: 100px;
    width: 125px;
    margin-top: 0px;
    margin-right: 20px;
    margin-bottom: 0;
    margin-left: 0;
}
#slider1 .overviewMid li span {
    float: left;
    padding: 1px;
    height: 100px;
    width: 200px;
    margin-top: 0px;
    margin-right: 20px;
    margin-bottom: 0;
    margin-left: 0;
}
.overview li a {
    opacity: .7;
}
.overview li a:hover {
    opacity: 1;
}

请帮忙!感谢。

0 个答案:

没有答案