console.log(jj.height()) 这个是0
只有在火狐下是正常的..ie跟谷歌是0,
但是如果换成append就正常了...
为什么会这样啊?
.hh{
width:100px;
height: 100px;
background:red
}
<div style="width:500px;margin:10px auto"></div>
var jj; function cc(){
aa()
bb()
}
cc() function aa(){
var el = $("<div class='hh' />").css({
"position" : "absolute",
"top" : "0px",
"left" : "0px"
});
$("div").wrapInner(el);
jj = el;
} function bb(){
console.log(jj)
console.log(jj.height())
}
jqueryjavascript
只有在火狐下是正常的..ie跟谷歌是0,
但是如果换成append就正常了...
为什么会这样啊?
.hh{
width:100px;
height: 100px;
background:red
}
<div style="width:500px;margin:10px auto"></div>
var jj; function cc(){
aa()
bb()
}
cc() function aa(){
var el = $("<div class='hh' />").css({
"position" : "absolute",
"top" : "0px",
"left" : "0px"
});
$("div").wrapInner(el);
jj = el;
} function bb(){
console.log(jj)
console.log(jj.height())
}
jqueryjavascript
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货