如果您访问http://oandg.co.uk.s156312.gridserver.com/#work并选择一个投资组合项目并单击“更多”,您将看到一个图像和一个角落带有小“i”的文本框.
我想这样做,如果您单击小“我”,文本框会消失,如果再次单击它会显示。
我试过了,但它什么也没做:
$(function() {
$(".openBoxButton").click(function() {
$('#colorbox').fadeIn(1200);
$.colorbox();
$('.rsABlock img.info').click(function(e) {
e.preventDefault();
$('.caption-background').toggleClass('hidden');
});
});
});
HTML:
<!-- Slide One -->
<div id="simple-slider-one" class="royalSlider rsDefault" style="width: 100%;">
<a class="rsImg" href="images/Froosh/froosh1.jpg">
<div class="rsABlock">
<img src="images/info.svg" alt="" class="info">
<div class="caption-background">
<h4>What we did for them</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem distinctio deserunt nostrum illum dolor obcaecati eaque ipsam! Distinctio, ipsa accusamus saepe temporibus ex pariatur possimus quidem sapiente obcaecati labore iusto.</p>
</div>
</div>
</a>
<a class="rsImg" href="images/Froosh/froosh2.jpg">
<div class="rsABlock">
<img src="images/info.svg" alt="" class="info">
<div class="caption-background">
<h4>What we did for them</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem distinctio deserunt nostrum illum dolor obcaecati eaque ipsam! Distinctio, ipsa accusamus saepe temporibus ex pariatur possimus quidem sapiente obcaecati labore iusto.</p>
</div>
</div>
</a>
有任何想法吗?