html col 隐藏,html – Bootstrap响应式网格布局(3列),每个网格元素下方都有折叠/隐藏的col-12...

我正在尝试使100%列出现在引导网格的coloumn内的元素下面.因为用图片更容易理解,所以我想要实现的目标:

选择其中一个图像(1到x)时,隐藏的div(每个不同的内容)应该以完整的12列大小显示在图像下方:

我设法做到这一点,但是,当使用较小的分辨率时,这个隐藏的div显示在第三个元素下面,而不是在元素1下面.这应该是这样的:

很高兴能得到一些帮助!

这是实际版本的代码片段:

// hide all

$('.descriptions .panel').hide();

// handle img click

$('#grid img').click(function() {

// get index of the img that was clicked

var idx = $(this).parent().parent().parent().index();

var row = $(this).parent().parent().parent().parent().next('.row');

// remove special style from all others

$('#grid img').removeClass('highlight');

// add a special style to the clicked image

$(this).addClass('highlight');

// hide all others

$('.descriptions .panel').hide();

// show desc for clicked img

row.find('.descriptions .panel').eq(idx).show();

});

.img-responsive{

margin: 0 auto;

}

text

text

text

Content here for image 1.. Blah blah blah,blah blah. That is very interesting stuff. Aenean sit amet felis

dolor,in sagittis nisi. Sed ac orci quis tortor imperdiet venenatis.

Content here for image 2.. Blah blah blah,in sagittis nisi. Sed ac orci quis tortor imperdiet venenatis.
Content here for image 3.. Blah blah blah,in sagittis nisi. Sed ac orci quis tortor imperdiet venenatis.

text

text

text

Content here for image 1.. Blah blah blah,in sagittis nisi. Sed ac orci quis tortor imperdiet venenatis.

[...]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值