0
我试图使用不工作的功能,所以我测试的长度选择(应该是):生成jQuery的HTML元素的1预计长度,element.length返回15
$('header').append('<p id="ancho_ventana"></p>');
$(document).ready(function(){
alert(('p#ancho_ventana').length); //outputs "15"
});
而且尝试与
var ancho = $('<p id="ancho_ventana"></p>').hide();
$(document).ready(function(){
$(window).bind('resize',function(){
alert(('p#ancho_ventana').length);
})
});
而第二个功能输出相同。这是为什么发生?
+1。他的当前行'alert('p#ancho_ventana')。length);'无论如何都会产生语法错误,但这可能是一个打字错误。 – Alex
bufff ...太困了谢谢! –