웹프로그래밍

Global It Leader!!


HTML/CSS


 
 

CSS FF와 IE에서 사용되는 자바스크립트의 7가지 차이점

페이지 정보

작성자 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 6,185회 작성일 11-06-01 19:23

본문


1. CSS "float" 속성
   - IE 문법
     1. document.getElementById("header").style.styleFloat = "left";  
   - FF 문법
     1. document.getElementById("header").style.cssFloat = "left";

2. Computed Style
   <div style="background-color:#red;"></div>
   이런식으로 작업할 경우
   document.getElementsByTagName('div')[0].style.backgroundColor할 경우 값을 가져 올 수 있지만
   <div id="header" class="red"></div>
   클래스를 주고 css를 정의할 경우 위와 같은 방식으로는 값을 가져 올 수 없습니다.

   해서 위의 내용과 값이 클래스명으로 값을 줬을 경우는 다음과 같이 해주셔야 합니다.
   - IE 문법
   1. var myObject = document.getElementById("header");  
   2. var myStyle = myObject.currentStyle.backgroundColor;  
   - FF 문법
   1. var myObject = document.getElementById("header");  
   2. var myComputedStyle = document.defaultView.getComputedStyle(myObject, null);  
   3. var myStyle = myComputedStyle.backgroundColor;  

3. class명을 스크립트에서 가져올때
   - IE 문법
   1. var myObject = document.getElementById("header");  
   2. var myAttribute = myObject.getAttribute("className");  
   - FF 문법
   1. var myObject = document.getElementById("header");  
   2. var myAttribute = myObject.getAttribute("class");  

4. Label 태그의 for속성을 접근할때는
   - IE 문법
   1. var myObject = document.getElementById("myLabel");  
   2. var myAttribute = myObject.getAttribute("htmlFor");  
   - FF 문법
   1. var myObject = document.getElementById("myLabel");  
   2. var myAttribute = myObject.getAttribute("for");  

5. Cursor의 포인터를 가져올때는
   - IE 문법
   1. var myCursorPosition = [0, 0];  
   2. myCursorPosition[0] = event.clientX;  
   3. myCursorPosition[1] = event.clientY;  
   - FF 문법
   1. var myCursorPosition = [0, 0];  
   2. myCursorPosition[0] = event.pageX;  
   3. myCursorPosition[1] = event.pageY;  

6. Viewport의 크기나 브라우져의 윈도우 사이즈를 가져올때
   - IE 문법
   1. var myBrowserSize = [0, 0];  
   2. myBrowserSize[0] = document.documentElement.clientWidth;  
   3. myBrowserSize[1] = document.documentElement.clientHeight;  
   - FF 문법
   1. var myBrowserSize = [0, 0];  
   2. myBrowserSize[0] = window.innerWidth;  
   3. myBrowserSize[1] = window.innerHeight;  

7. 투명 Alpha값
   - IE 문법
   1. #myElement {  
   2.     filter: alpha(opacity=50);  
   3. }  

   1. var myObject = document.getElementById("myElement");  
   2. myObject.style.filter = "alpha(opacity=80)";  

   - FF 문법
   1. #myElement {  
   2.     opacity: 0.5;  
   3. }  

   1.var myObject = document.getElementById("myElement");  
   2.myObject.style.opacity = "0.5";  

[이 게시물은 운영자님에 의해 2025-12-20 22:17:11 CSS에서 이동 됨]

댓글목록

등록된 댓글이 없습니다.

전체 115
게시물 검색
HTML/CSS 목록
번호 제목 글쓴이 조회 날짜
열람중 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6186 06-01
114 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 8235 05-12
113 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5016 05-20
112 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4118 05-20
111 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3609 05-14
110 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3751 04-27
109 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3665 02-04
108 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4234 09-06
107 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3932 01-28
106 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4382 01-21
105 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4024 01-21
104 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4135 12-23
103 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4441 08-19
102 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4382 03-08
101 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4298 02-08
100 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4911 04-17
99 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4831 02-17
98 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4815 02-17
97 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4735 02-17
96 CSS no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6560 09-18