본문 바로가기

jquery 각 컨텐츠 높이 구하기 -> 배열에 넣

slide_list 

<div class="space_detail_contents_part">
	<div class="space_detail_contents_item" id="slide_list_1">...</div>
	<div class="space_detail_contents_item" id="slide_list_2">...</div>
	<div class="space_detail_contents_item" id="slide_list_3">...</div>
	<div class="space_detail_contents_item" id="slide_list_4">...</div>
	<div class="space_detail_contents_item" id="slide_list_5">...</div>
	<div class="space_detail_contents_item" id="slide_list_6">...</div>
	<div class="space_detail_contents_item" id="slide_list_7">...</div>
	<div class="space_detail_contents_item" id="slide_list_8">...</div>
	<div class="space_detail_contents_item" id="slide_list_9">...</div>
	<div class="space_detail_contents_item" id="slide_list_10">...</div>
</div>

.offset()

var _offset_arr = [];
$("div[id^=slide_list]").each(function(){
   _offset_arr.push($(this).offset());
});

console.log(_offset_arr);

 

 

.push($(this).offset());

var _offset_arr = [];
$("div[id^=slide_list]").each(function(){
   _offset_arr.push($(this).offset());
});

console.log(_offset_arr);