使用 jquery 循环插件时链接不起作用
我有这个 HTML 代码:
<div class="headerPages">
<div style="right: 0px">
<ul dir="rtl">
<li class="headerLinksItem"><img src="images/numbers/1.png" alt="" width="20" height="22" align="absmiddle" /> <a href="subscribes.php">1</a></li>
<li class="headerLinksItem"><img src="images/numbers/2.png" alt="" width="20" height="22" align="absmiddle" /> <a href="advertisement.php">2</a></li>
<li class="headerLinksItem"><img src="images/numbers/3.png" alt="" width="20" height="22" align="absmiddle" /> <a href="contactPage.php">3</a></li>
<li class="headerLinksItem"><img src="images/numbers/4.png" alt="" width="20" height="22" align="absmiddle" /> <a href="newsBar.php">4</a></li>
</ul>
</div>
<div style="right: 0px; opacity: 0">
<ul dir="rtl">
<li class="headerLinksItem"><img src="images/numbers/1.png" alt="" width="20" height="22" align="absmiddle" /> <a href="manageAlbums.php">5</a></li>
<li class="headerLinksItem"><img src="images/numbers/2.png" alt="" width="20" height="22" align="absmiddle" /> <a href="words.php">6</a></li>
<li class="headerLinksItem"><img src="images/numbers/3.png" alt="" width="20" height="22" align="absmiddle" /> <a href="addVideo.php?type=1">7</a></li>
<li class="headerLinksItem"><img src="images/numbers/4.png" alt="" width="20" height="22" align="absmiddle" /> <a href="addVideo.php?type=2">8</a></li>
</ul>
</div>
<div style="right: 0px; opacity: 0">
<ul dir="rtl">
<li class="headerLinksItem"><img src="images/numbers/1.png" alt="" width="20" height="22" align="absmiddle" /> <a href="infoControl.php">9</a></li>
<li class="headerLinksItem"><img src="images/numbers/2.png" alt="" width="20" height="22" align="absmiddle" /> <a href="partners.php">10</a></li>
<li class="headerLinksItem"><img src="images/numbers/3.png" alt="" width="20" height="22" align="absmiddle" /> <a href="personalPage.php">11</a></li>
<li class="headerLinksItem"><img src="images/numbers/4.png" alt="" width="20" height="22" align="absmiddle" /> <a href="manageVotes.php">12</a></li>
</ul>
</div>
<div style="right: 0px; opacity: 0">
<ul dir="rtl">
<li class="headerLinksItem"><img src="images/numbers/1.png" alt="" width="20" height="22" align="absmiddle" /> <a href="main.php">13</a></li>
</ul>
</div>
</div>
和这个 javascript 代码:
$('.headerPages').cycle({
timeout: 0,
next: '#next',
prev: '#prev'
});
一切都工作正常,但是当我尝试单击每张幻灯片中的链接时,我不能,并且我从上一张幻灯片中获取链接,因为它的不透明度设置为 0 并且z-index 属性就像这个插件工作的图层一样。
我尝试使用 cssAfter, cssBefore
但它不起作用,也不
知道如何解决这个问题?
I have this HTML code :
<div class="headerPages">
<div style="right: 0px">
<ul dir="rtl">
<li class="headerLinksItem"><img src="images/numbers/1.png" alt="" width="20" height="22" align="absmiddle" /> <a href="subscribes.php">1</a></li>
<li class="headerLinksItem"><img src="images/numbers/2.png" alt="" width="20" height="22" align="absmiddle" /> <a href="advertisement.php">2</a></li>
<li class="headerLinksItem"><img src="images/numbers/3.png" alt="" width="20" height="22" align="absmiddle" /> <a href="contactPage.php">3</a></li>
<li class="headerLinksItem"><img src="images/numbers/4.png" alt="" width="20" height="22" align="absmiddle" /> <a href="newsBar.php">4</a></li>
</ul>
</div>
<div style="right: 0px; opacity: 0">
<ul dir="rtl">
<li class="headerLinksItem"><img src="images/numbers/1.png" alt="" width="20" height="22" align="absmiddle" /> <a href="manageAlbums.php">5</a></li>
<li class="headerLinksItem"><img src="images/numbers/2.png" alt="" width="20" height="22" align="absmiddle" /> <a href="words.php">6</a></li>
<li class="headerLinksItem"><img src="images/numbers/3.png" alt="" width="20" height="22" align="absmiddle" /> <a href="addVideo.php?type=1">7</a></li>
<li class="headerLinksItem"><img src="images/numbers/4.png" alt="" width="20" height="22" align="absmiddle" /> <a href="addVideo.php?type=2">8</a></li>
</ul>
</div>
<div style="right: 0px; opacity: 0">
<ul dir="rtl">
<li class="headerLinksItem"><img src="images/numbers/1.png" alt="" width="20" height="22" align="absmiddle" /> <a href="infoControl.php">9</a></li>
<li class="headerLinksItem"><img src="images/numbers/2.png" alt="" width="20" height="22" align="absmiddle" /> <a href="partners.php">10</a></li>
<li class="headerLinksItem"><img src="images/numbers/3.png" alt="" width="20" height="22" align="absmiddle" /> <a href="personalPage.php">11</a></li>
<li class="headerLinksItem"><img src="images/numbers/4.png" alt="" width="20" height="22" align="absmiddle" /> <a href="manageVotes.php">12</a></li>
</ul>
</div>
<div style="right: 0px; opacity: 0">
<ul dir="rtl">
<li class="headerLinksItem"><img src="images/numbers/1.png" alt="" width="20" height="22" align="absmiddle" /> <a href="main.php">13</a></li>
</ul>
</div>
</div>
and this javascript code:
$('.headerPages').cycle({
timeout: 0,
next: '#next',
prev: '#prev'
});
every thing is working fine but when I am trying to click links in each slide, I can't and I get links from the prev slide because of the opacity it's set to 0 and the z-index property like layers as this plugin work.
I tried to use cssAfter, cssBefore
and it's not working also
any idea how to solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我今天遇到了同样的问题,并发现循环为活动幻灯片设置了一个类。所以你可以轻松地使用 CSS 来代替回调函数:
I´ve came across the same problem today and found out that cycle sets a class for the active slide. So you easily can use CSS instead of the callback function:
我对这个完美的插件有完全相同的问题。经过一番摸索后,我找到了一个使用
after
回调自动重置z-index
的解决方案。使用cssAfter
也应该可以实现。I had the exact same issue with this otherwise perfect plugin. After a bit of fumbling, I settled for a solution using the
after
callback to automatically reset thez-index
. It should be doable usingcssAfter
as well.