0

对于 js 滑块,我们使用跨度“slider_link”将整个包含的 div 变成可点击的链接。问题是第一个 div 似乎保持原位,因此即使幻灯片发生链接也永远不会改变。我们希望每张幻灯片的链接都与该幻灯片一起出现。

问题演示

HTML 摘录:

<div class="slider1">
<div class="slider-text slider-text1">
<a href="http://www.abacusnyc.com/about-us/overview"><span class="slider_link"></span></a>
<h1><span>Differentiate.</span> Shouldn't your recruitment firm stand out as much as you do.</h1>
<p>Human Resourcefulness is finding the right people, right now.</p>

</div>
</div>

CSS 摘录:

.slider_link { 
    float:left;
     position:absolute;
     width:100%;
     height:100%;
     top:0;
     left: 0;

  /* edit: added z-index */
      z-index:inherit;

  /* edit: fixes overlap error in IE7/8, 
     make sure you have an empty gif */
     background-image: url('../images/empty.gif');
}  
4

1 回答 1

0

将相对定位放在包装器 div 中!

于 2013-01-27T01:48:51.040 回答