개발자공간/SCRIPT

jquery - 요소 클릭시 요소위치에 레이어팝업

냉국이 2020. 12. 15. 10:43
728x90

 

 

요소 클릭시 클릭한 요소 위치에 레이어팝업 띄우기

$('.element').unbind('click').bind('click',function(e){
	target = $(e.target);
	var p = $(target).offset();

	var divTop 	= p.top - 25; //상단 좌표 
	var divLeft = p.left; //좌측 좌표 

	//레이어 팝업 view
	$('.layer_popup').css({ "z-index":'10000',"top": divTop ,"left": divLeft , "position": "absolute" }).show();
});
300x250