【发布时间】:2015-02-04 16:27:35
【问题描述】:
我有一个像这样设置的 div
<div class="clickformore">
<h3>Business in<br>action</h3>
<div class="foundoutmore">
<div class="uparrow"></div>
<div class="underarrow">
<p>Develop critical and problem solving skills faculties by investigating challenges faced by business leaders and to practice the skills to devise and implement practical solutions.<br><a href="http://www.ncl.ac.uk/postgraduate/modules/module/NBS8490/" target="_blank">http://www.ncl.ac.uk/postgraduate/modules/module/NBS8490/</a></p>
</div>
</div>
</div>
只有 h3 是可见的,其他的都是隐藏的。 jQuery 显示找到的更多 div,其中包含箭头和文本框,使其看起来像一个气泡。
但是当用户点击隐藏的 div 中的链接时,它会再次隐藏,而不是打开链接。
$(".clickformore").click(function(e){
e.preventDefault();
if ($(this).find(".foundoutmore").css('display') == 'none') {
$(".foundoutmore").css("display","none");
$(this).find(".foundoutmore").css("display","inherit");
} else {
$(".foundoutmore").css("display","none");
}
});
我已经尝试用 css 做一个 z-index 来瞄准链接,希望它在 div 隐藏无济于事之前首先是可点击的,我试图找出一种方法让显示的 div 不再隐藏它,但我无法弄清楚系绳的结束。
有没有办法在 div 隐藏之前使链接可点击?
【问题讨论】: