LANGUAGE/HTML & CSS & JS 2016. 8. 23. 17:35

///// JavaScript (자바스크립트)






///// CSS (씨에스에스)


- transition

body{

transition: width 2s, height 2s, background-color 2s, transform 2s;

}


CSS 트랜지션 사용하기

https://developer.mozilla.org/ko/docs/Web/CSS/CSS_Transitions/Using_CSS_transitions





- transition 적용이 안될 때

- window.getComputedStyle(el)


//객체 생성

var el = doument.createElement('div');

el.style.background = 'white';

el.style.transition = 'background-color 2s';


//객체 붙이면서 transition 효과 적용하기

document.body.appendChild(el);

window.getComputedStyle(el).background;

el.style.background = 'black';



 - for IE

if (!window.getComputedStyle) {

  window.getComputedStyle = function(element) {

    return element.currentStyle;

 }

}


Trigger CSS transition on appended element

http://stackoverflow.com/questions/24148403/trigger-css-transition-on-appended-element


JavaScript Window getComputedStyle() Method

http://www.w3schools.com/jsref/jsref_getcomputedstyle.asp


IE 하위 버전을 위한 getComputedStyle()

http://blog.naver.com/hwpyky/140162681852






///// Trigger Parent Frame


- JQuery

$('#x',parent.document.body).blur(); 





///// getBoundingClientRect()


- Element.getBoundingClientRect()


- FrameElement.getBoundingClientRect()





///// 프레임(frame)까지 고려해서 해당 객체의 위치 얻기


How to get the position of an iframe relative to the top window's viewport?

http://stackoverflow.com/questions/9675445/how-to-get-the-position-of-an-iframe-relative-to-the-top-windows-viewport





///// 해당 요소의 document 얻기


var doc = element.ownerDocument; 

var win = doc.defaultView || doc.parentWindow;



Get reference of window object from a dom element

http://stackoverflow.com/questions/16010204/get-reference-of-window-object-from-a-dom-element