请问下jQuery平滑改变元素高度的问题
答案:3 悬赏:60 手机版
解决时间 2021-03-28 21:53
- 提问者网友:半生酒醒
- 2021-03-28 11:18
请问下jQuery平滑改变元素高度的问题
最佳答案
- 五星知识达人网友:蓝房子
- 2021-03-28 11:51
$(".conbox").animate({"height" : h-180+"px"}, 500);
全部回答
- 1楼网友:野味小生
- 2021-03-28 13:04
$(function() {
$('#btn').click(function() {
if($('#test').css('height') == $('#test_son').css('height')) {
$('#test').css('height',10);
}else{
$('#test').css('height','auto');
}
});
});
追问谢谢,你这种思路也不错,通过比较两DIV的高度来实现
$('#btn').click(function() {
if($('#test').css('height') == $('#test_son').css('height')) {
$('#test').css('height',10);
}else{
$('#test').css('height','auto');
}
});
});
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯