//드랍 메뉴
var drop_menu_data = "";
var drop_menu_num = "";
function drop_menu(obj){
drop_menu_data = $(obj).text();
drop_menu_num = $(obj).parent().prev().children().attr('name').replace("crawling_status", "");
var drop_top = $(obj).offset().top - 70;
var drop_left = $(obj).offset().left - (($("#drop").outerWidth() - $(obj).width()) / 2);
var droparrow_top = drop_top + $("#drop").outerHeight();
var droparrow_left = $(obj).offset().left - (($("#drop-arrow").outerWidth() - $(obj).width()) / 2);
$("#drop").css('top', drop_top); $("#drop").css('left', drop_left);
$("#drop-arrow").css('top', droparrow_top); $("#drop-arrow").css('left', droparrow_left);
$("#drop").show('fast');
$("#drop-arrow").show('normal');
}
<!-- 드롭다운 -->
<div id="drop" class="area" style="border: 3px solid #5ccdde; border-radius: 10px; padding: 10px; background-color: white; position: absolute; left:0; top:0; display: none;">
<a type="button" class="btn btn-effect-ripple btn-primary area" style="padding-left: 10px; padding-right: 10px;" href="javascript:void(0)" onclick="search_symbol()" target="_blank">상세페이지</a>
<a type="button" class="btn btn-effect-ripple btn-primary area" style="padding-left: 10px; padding-right: 10px;" href="javascript:void(0)" onclick="add_standard()">추가</a>
</div>
<div id="drop-arrow" class="area" style="width: 20px; height:20px; border-top: 10px solid #5ccdde; border-right: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 10px solid transparent; position: absolute; left:0; top:0; display: none;">
</div>
'DEV > JavaScript' 카테고리의 다른 글
자바스크립트 큰 수 팩토리얼 (0) | 2021.08.07 |
---|---|
Safari new Date 형 변환시 NaN (0) | 2017.12.13 |
별 색칠하기 (0) | 2017.11.22 |
팝업 자동사이즈 autosize (0) | 2017.10.23 |