글
까먹지 말자! 2010/01/06 16:58090106
오늘의 메모 1. IE6에서는 min-height,max-width따위의 것들이 먹지 않는다.
IE6에서는 min-height,max-width따위의 것들이 먹지 않는다.
reference : http://www.clearboth.org/wiki/doku.phpid=document:ultimate_ie6_cheatsheet#max height
Min Height
/*Works in all browsers*/ #container {min-height:200px; height:auto !important; height:200px;}
똑같은 효과를 얻기 위한 다른 방법:
/*For IE6*/ #container {min-height:200px; height:200px;} /*For all other browsers*/ html>body #container { height:auto;}
Max Height
불행하게도, IE6에서 최대 높이 효과를 내는 방법은 스타일시트에서 자바스크립를 실행하는 것과 동일한 방법인, 특정 IE를 위한 CSS 표현을 사용하거나, 자바스크립트를 사용하는 것이다. 둘 중에, 나는 처리능력 면에서 비용이 많이 들고, 브라우저가 망가질 수도 있는 CSS 표현보다는 자바스크립트 방법을 추천한다. 둘 다 자바스크립트가 비활성화 되어 있으면 기능하지 않을 것이다. 모든 다른 브라우저들은 최대 높이를 지원하기 때문에, 이 솔루션은 오직 IE6만을 위한 것임을 명심해라.
JavaScript
//Plain JavaScript, change the ID and dimensions to suit your code. var container = document.getElementById('container'); container.style.height = (container.scrollHeight > 199) ? "200px" : "auto"; //An alternative function. Note: for dynamic resizing, attach to the window resize event function setMaxHeight(elementId, height){ var container = document.getElementById(elementId); container.style.height = (container.scrollHeight > (height - 1)) ? height + "px" : "auto"; } //Example usage setMaxHeight('container1', 200); setMaxHeight('container2', 500);
오늘의 메모 2. onload이벤트 처리기에 등록한 function()들 . .예를들어 dojo프레임워크를 이용하여 구성한 어떤 컴포넌트
예 Sequence : A라는 객체가 인스턴싱됨 A라는 객체는 B라는 객체를 인스턴싱함
A클래스와 B클래스의 내부의 각각의 생성자에 dojo.onLoad("_init");와 같이 각각의_init()메소드를 onLoad이벤트 처리기에 등록해두고
A의 _init에서 B객체를 생성하고, B객체의 인터페이스에 접근하면 어떻게 동작할까?
결과>>
A객체의 _init()이 onLoad이벤트기에서 실행되고 있는 동안 B객체의 _init()는
수행되지 못하고 onLoad이벤트 큐에서 대기하고 있는 상태로서 B객체가 기대 했던
대로 완전하게 인스턴싱되어 있지 않은 상태다.
따라서 A의 _init()가 모두 수행되기 전에 B의 인스턴스에 접근하면, undefined가
발생한다.
'음 너무 두서없이 생각나는데로 너덜너덜 적어 버렷다;;;;; 이 차이점 떄문에 나름 헤맷었다;'
var id = setTimeout(fn, delay);- Initiates a single timer which will call the specified function after the delay. The function returns a unique ID with which the timer can be canceled at a later time.var id = setInterval(fn, delay);- Similar tosetTimeoutbut continually calls the function (with a delay every time) until it is canceled.clearInterval(id);,clearTimeout(id);- Accepts a timer ID (returned by either of the aforementioned functions) and stops the timer callback from occurring.

RECENT COMMENT