1
변수
에서 클릭 된 요소 저장소의 폭을 얻을 나는 몇 가지 기본적인 마크 업을 가지고있다. 다음 jQuery 코드가 있습니다 :jQuery를이
var listWidth = [];
$('.content').click(function(){
listWidth.push($(this).width());
});
console.log(listWidth);
너비 값을 배열로 전달하지 않습니다. 다음과 같이 알림을 사용할 때 작동합니다.
var listWidth = [];
$('.content').click(function(){
alert($(this).width());
});
console.log(listWidth);
나를 도와 줄 수있는 사람이 있습니까? 미리 감사드립니다.
클릭 기능이 트리거되기 전에 배열을 로그합니다 – rsplak