본문 바로가기

Javascript8

jqgrid 동적 Height 처리 // 화면 리사이즈시 실행 $(window).resize(function () { const doc_height = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0) $(".ui-jqgrid .ui-jqgrid-bdiv").css("max-height",doc_height + "px"); }); window.addEventListener("DOMContentLoaded", (event) => { window.dispatchEvent(new Event('resize')); }); 2023. 4. 24.
insertAfter가 필요할때 insertBefore는 있는데 insertAfter는 없다. var rootDom = document.getElementById("root"); var n = 3; // 4번째 다음 위치에 표시할 경우 var insertDom = document.createElement("div"); // 입력할 화면 작업 수행 rootDom.insertBefore(insertDom, rootDom.childNodes[n].nextSibling); 2020. 9. 3.
Vertical Animation 방법 1. transition 사용법 #TICKER {display:none;}@media (min-width: 600px) {#TICKER {bottom: 32px;left: 32px;margin-left: 0;right: 32px;top: 32px !important;width: auto;position: fixed;display:block;}#TICKER_LAYOUT {box-sizing: border-box;width: 300px;max-height: 0px;right:0px; bottom: 0px;position: absolute;overflow: hidden;background-color:red;-webkit-transition: 3s;-moz-transition: 3s;-ms-transition:.. 2018. 5. 2.
browser 이름 및 version script function getbrowserinfo () { var ua=navigator.userAgent,tem,M=ua.match(/(edge|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [],Edge = ua.match(/(edge(?=\/))\/?\s*(\d+)/i) || []; if(/trident/i.test(M[1])){ tem=/\brv[ :]+(\d+)/g.exec(ua) || []; return {name:'IE',version:(tem[1]||'')}; } else if ( Edge != null && Edge != '' ) { return { name: 'Edge', version: Edge[2] }; } else if.. 2018. 2. 26.
Chrome 301 Redirect 현황 보기 chrome://net-internals 2018. 2. 21.
css 추가 javascript addbackgroundcss :{value : function(layout) {if ( layout['bg_img'] == '' )return;var css = '{ }', head = this.root.head; style = document.createElement('style');style.type = 'text/css';if (style.styleSheet){ style.styleSheet.cssText = css;} else { style.appendChild(document.createTextNode(css));}head.appendChild(style);}}, 2018. 2. 19.
javascript 사이즈 별 계산해서 ellipsis 시키는 함수 function ellipsizeTextBox(el) { var keep = el.innerHTML; while(el.scrollHeight > el.offsetHeight) { alert(el.scrollHeight +" " + el.offsetHeight); el.innerHTML = keep; el.innerHTML = el.innerHTML.substring(0, el.innerHTML.length-1); keep = el.innerHTML; el.innerHTML = el.innerHTML + "..."; }} 파이어 폭스에서 무한 루프가 발생하므로 주의 할것... 2018. 2. 2.
iframe document.write vs innerHTML iframe 내부의 javascript 가 로딩시에 구동되지 않는 현상이 있어서 처리 방법에 대해서 추가한다. iframe.contentDocument.write 시에 open , close 로 클로징해야 하며 이를 사용시에는 javacript 가 구동된다. innerHTML 을 사용할 경우 수행되지 않는다. firefox 의 경우 innerHTML 이 작동하지 않을 경우 var _GOODDEV_IFRAME = document.getElementById('iframe ID명');var _GOODDEV_IFRAME_DOC = _GOODDEV_IFRAME.contentWindow || ( _GOODDEV_IFRAME.contentDocument.document || _GOODDEV_IFRAME.content.. 2018. 1. 3.