差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
| study:javascript:positioning [2008/02/03 16:44] – banana | study:javascript:positioning [2011/08/04 02:13] (現在) – [Fixed Layer] banana | ||
|---|---|---|---|
| 行 30: | 行 30: | ||
| </ | </ | ||
| 여기서 눈여겨 볼 부분은 * html body부분이다. 이부분은 IE만 해석할 수 있는 데, 화면 떨림방지를 위한 hack이다. | 여기서 눈여겨 볼 부분은 * html body부분이다. 이부분은 IE만 해석할 수 있는 데, 화면 떨림방지를 위한 hack이다. | ||
| - | 자세한 것은 forum의 javascript관련 post를 참고하기 바란다. | + | 자세한 것은 forum의 javascript관련 |
| 다음은 javascript부분으로 이부분은 설명없어도 이해할 것으로 생각한다. setTimeout대신에 window.onresize = function(){ }을 사용하여도 무방하다. 아래가 관련 javascript code snippet이다. | 다음은 javascript부분으로 이부분은 설명없어도 이해할 것으로 생각한다. setTimeout대신에 window.onresize = function(){ }을 사용하여도 무방하다. 아래가 관련 javascript code snippet이다. | ||
| 行 36: | 行 36: | ||
| function adjust(){ | function adjust(){ | ||
| var screenWidth=0; | var screenWidth=0; | ||
| - | var screenHeight=0; | + | var screenHeight=0; |
| - | if(window.innerWidth){ | + | if(window.innerWidth) { //FireFox, NN |
| - | screenWidth = window.innerWidth; | + | screenWidth = window.innerWidth; |
| - | screenHeight = window.innerHeight; | + | screenHeight = window.innerHeight; |
| - | }else{ | + | } else { //IE |
| - | if(document.compatMode && document.compatMode==' | + | if(document.compatMode && document.compatMode==' |
| - | screenWidth = documentElement.clientWidth; | + | screenWidth = documentElement.clientWidth; |
| - | screenHeight = documentElement.clientHeight; | + | screenHeight = documentElement.clientHeight; |
| - | }else{ | + | } else { //Quirks Mode |
| - | screenWidth = document.body.clientWidth; | + | screenWidth = document.body.clientWidth; |
| - | screenHieght = document.body.clientHeight; | + | screenHieght = document.body.clientHeight; |
| - | }//end if~else | + | |
| }//end if~else | }//end if~else | ||
| + | }//end if~else | ||
| - | var contentWidth = screenWidth - 180; | + | var contentWidth = screenWidth - 180; |
| - | if(contentWidth< | + | if(contentWidth< |
| - | if(screenHeight< | + | if(screenHeight< |
| - | //set the content' | + | //set the content' |
| - | document.getElementById(" | + | document.getElementById(" |
| - | document.getElementById(" | + | document.getElementById(" |
| - | setTimeout(" | + | setTimeout(" |
| - | }//adjust | + | }//adjust |
| </ | </ | ||
| + | |||
| + | {{keywords> | ||
| + | |||
| ===== See the sample ===== | ===== See the sample ===== | ||
| 行 76: | 行 79: | ||
| < | < | ||
| - | <a href="#" | + | <a href="#" |
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | ~~DISCUSSION~~ | ||