html div 隐藏显示,jQuery div内容部分隐藏,显示全部

我有

this solution我试图使用,但它使用ID.我希望使用相同的类在同一页面上使用多个div.我将ID引用更改为类,但我不能让它们彼此独立地触发.他们都在同一时间开火.我如何让他们独立开火.我想通过将函数包装在.each()中来修复它,但似乎仍然会同时触发所有我的div.

任何建议都非常有帮助.谢谢.

$(function(){

var slideHeight = 75; // px

var defHeight = $('.wrap').height();

if(defHeight >= slideHeight){

$('.wrap').css('height' , slideHeight + 'px');

$('.read-more').append('Click to Read More');

$('.read-more a').click(function(){

var curHeight = $('.wrap').height();

if(curHeight == slideHeight){

$('.wrap').animate({

height: defHeight

}, "normal");

$('.read-more a').html('Close');

$('.gradient').fadeOut();

}else{

$('.wrap').animate({

height: slideHeight

}, "normal");

$('.read-more a').html('Click to Read More');

$('.gradient').fadeIn();

}

return false;

});

}// end if

});

我的HTML

< div class =“container”>

< h1> jQuery幻灯片,最小高度< / h1>

About Billabong

Gordon Merchant founded Billabong in Burleigh Heads on the Gold Coast in 1973. Combining his passion for surfing with hard work, Gordon designed boardshorts, manufacturing them on the kitchen table and selling through local surf shops and markets.

Gordon developed his own stitching technique, which made the garments more durable, cost effective and less labor intensive. He employed machinists, moved the operation into a factory, set up a distribution network and sponsored a team of renowned Australian surfers. The business thrived.

Since those beginnings, Billabong has expanded its product range to include boardsport products such as wetsuits, watches, surfboards, snowboard outerwear and skateboarding apparel.

Information courtesy of Billabong.

< div class =“container”>

jQuery slide with minimum height Content 2

About Billabong

Gordon Merchant founded Billabong in Burleigh Heads on the Gold Coast in 1973. Combining his passion for surfing with hard work, Gordon designed boardshorts, manufacturing them on the kitchen table and selling through local surf shops and markets.

Gordon developed his own stitching technique, which made the garments more durable, cost effective and less labor intensive. He employed machinists, moved the operation into a factory, set up a distribution network and sponsored a team of renowned Australian surfers. The business thrived.

Since those beginnings, Billabong has expanded its product range to include boardsport products such as wetsuits, watches, surfboards, snowboard outerwear and skateboarding apparel.

Information courtesy of Billabong.

< / DIV>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值