javascript - 在jquery中这种情况怎么解决
本文介绍了javascript - 在jquery中这种情况怎么解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
如题:
function change(){
// alert("我在改变");
var current_height = ($(window).height()-200)+"px";
alert(current_height);
$("#c1"),attr("height",'current_height'); //改成("height",current_height)也没效果!!!!
$("#c2"),attr("height",'current_height');//改成("height",current_height)也没效果!!!!
}
怎么把动态改变的current_height值赋给height属性、、、
解决方案
on change(){
// alert("我在改变");
var current_height = ($(window).height()-200)+"px";
alert(current_height);
$("#c1").css("height",current_height);
$("#c2").css("height",current_height);
}
这篇关于javascript - 在jquery中这种情况怎么解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文