밤하늘의 실제별, 나도 가질 수 있다?!


« Previous : 1 : 2 : 3 : 4 : Next »
Expression.
인터넷 익스플로러(IE6,7)에서만 사용할 수 있는 CSS 표현입니다.
말도 많고 탈도 많은 녀석이죠.

자바스크립트가 최소단위인 천분의 일초로 작동을 한다면
이녀석은 수천분의 일초 아니 거의 만분의 일초까지도 되는 것 처럼 작동을 합니다.
(직접 세어보지는 않았습니다. 그냥 느낌이에요 느낌상-_-;)
예를 들어,
IE6에서는 표현이 불가능한 postion: fixed 속성을 expression으로 표현하면
스크롤을 겁나 빨리 내리고 올려도 울렁거림 없이 거의 완벽한 동작을 보여줍니다.

어떠한 동작(이벤트)이든 일어나는대로
이 수천분의 일초 간격으로 계속 대기하고 읽어들이고 값을 던져주고 있다는 겁니다.
그래서 브라우저에 부담을 주고 심지어는 브라우저를 멈추거나 셧다운-_- 시켜버린다는
무시무시한 소문을 안고 다니는 녀석이죠.

그래도 IE6에서는 지원되지 않는 수많은 CSS 속성을
expression을 사용하여 자바스크립트 언어로 표현이 가능한
엄청난 강점을 갖고 있어서 외면하려고 해도 가끔은 생각이납니다.-_-;

대략 2년 전인가요.
야후에서 근무하는 어떤 멋진(wow) 분이- (지금은 구글 olleh!)
expression의 살인적인 아니 살브라우저적인 호출을  상당히 줄여줄 수 있는 방법을 제시했습니다.


저 페이지를 처음 보았을 당시 전 이제 막 웹표준의 웹을 시작하고 있었던 터라
"음. 이런게 있군- expression 무서운 녀석." 이라고 그냥 넘기고 말았는데요.

오늘 max-height 때문에 expression을 써야하나 고민을 잠깐 하다가
max-height 같은 경우는 position: fixed 처럼 계속해서 읽어드릴 필요가 없이
페이지 열릴때 한번만 잡아주면 되거든요.
정말로 작동을 하는지, 진짜 차이가 있는건지 궁금해서 테스트 페이지를 한번 만들어 보았습니다.


예제 파일 : http://mkyoon.tomeii.com/expression.html (IE6, 7에서 보셔야 합니다.)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>One-Time Expressions</title>
<style type="text/css">
.onetime {
width: 200px;
padding: 10px;
border: 2px solid #666;
overflow: hidden;
/* 생각없이 쓴 expression */
height: expression( setCntr(), this.scrollHeight > 99 ? "100px" : "auto" );
/* 멋진 아저씨가 추천한 방법 */
/*height: expression(
setCntr(),
new Function('el', 'el.style.height = el.scrollHeight > 99 ? "100px" : "auto";')(this)
);*/
}
</style>
<script type="text/javascript">
//<![CDATA[
var gnExpr = 0;
var gCntrDisplay;
var gbOn = true;

function setCntr() {
gnExpr++;

if ( gbOn ) {
displayCntr();
}

return true;
}

function displayCntr() {
if ( ! gCntrDisplay ) {
gCntrDisplay = document.getElementById("cntrdisp");
}

if ( gCntrDisplay ) {
gCntrDisplay.value = gnExpr;
}
}

function setDisplay(bOn) {
gbOn = bOn;
}

//]]>
</script>
</head>
<body>
<input type="text" size="10" id="cntrdisp" disabled="disabled"/>
<div class="onetime">
(마우스를 움직여보세요.)
우리는 달려간다 이상한 나라로 니나가 잡혀있는 마왕의 소굴로
어른들은 모르는 사차원세계 날쌔고 용감한 폴이 여깄다
마술차 마술봉 딱부리 삐삐 찌찌 힘을 모으자 대마왕 손아귀에 니나를 구해내자
띠이빠빠 띠이빠빠 달려간다 삐삐
</div>
<p>출처 : http://stevesouders.com/hpws/onetime-expressions.php</p>
</body>
</html>

'생각없이 쓴 expression' 부분과
주석처리된 '멋진 아저씨가 추천한 방법'
주석부분을 바꿔서 열어보시면 차이를 바로 알 수 있습니다.
(정말로 딱 1개만 찍히네요. 오우 신기.)


결론 : expression 한번만 실행시키기.
CSSproperty: expression(
new Function('el', 'el.style.CSSproperty = 어쩌구 저쩌구 계산식')(this)
);



하지만 이방법도 완전한 해결책은 아니라고 하네요~
expression 자체가 위험하긴 하나봅니다. IE8에서도 내다버린 녀석이니까요.

Posted by mkyoon

2009/09/04 00:06 2009/09/04 00:06
, , , , , ,
Response
17 Trackbacks , No Comment
RSS :
http://mkyoon.com/rss/response/130

Trackback URL : http://mkyoon.com/trackback/130

Trackbacks List

  1. cryolite

    Tracked from cryolite 2009/10/01 06:53 Delete

    prophet muskwa <a href="http://prophet-muskwa.gscoiqrqnvq.com/">prophet muskwa</a> pucho <a href="http://pucho.gscoiqrqnvq.com/">pucho</a>

  2. Tracked from 2009/10/20 09:41 Delete

  3. liberator cube

    Tracked from liberator cube 2009/10/20 23:17 Delete

    defensewall driver not loaded <a href="http://defensewall-driver-not-loaded.ejatifyli.net/">defensewall driver not loaded</a> abloy locks <a href="http://abloy-locks.uvyduhin.net/">abloy locks</a>

  4. prince of egypt

    Tracked from prince of egypt 2009/10/20 23:51 Delete

    forniphilia <a href="http://forniphilia.asyhorigob.net/">forniphilia</a> drwatson postmortem debugger <a href="http://drwatson-postmortem-debugger.okosucusi.net/">drwatson postmortem debugger</a>

  5. onkyo tx-sr805

    Tracked from onkyo tx-sr805 2009/10/21 00:42 Delete

    timeless treasures fabric <a href="http://timeless-treasures-fabric.lajogibet.net/">timeless treasures fabric</a> corn fritter recipe <a href="http://corn-fritter-recipe.uvyduhin.net/">corn fritter recipe</a>

  6. angels ladies brothel

    Tracked from angels ladies brothel 2009/10/21 01:42 Delete

    tracer 9mm <a href="http://tracer-9mm.lajogibet.net/">tracer 9mm</a> air image purifier sharper <a href="http://air-image-purifier-sharper.asyhorigob.net/">air image purifier sharper</a>

  7. mundschenk wein

    Tracked from mundschenk wein 2009/10/21 02:33 Delete

    paula begoun <a href="http://paula-begoun.urycajuc.net/">paula begoun</a> anthony burger <a href="http://anthony-burger.mimawofot.net/">anthony burger</a>

  8. wellsboro pa

    Tracked from wellsboro pa 2009/10/21 03:30 Delete

    sugar busters <a href="http://sugar-busters.amivapuhox.net/">sugar busters</a> miltf videos sample <a href="http://miltf-videos-sample.amivapuhox.net/">miltf videos sample</a>

  9. rapid heart rate cozaar

    Tracked from rapid heart rate cozaar 2009/10/21 04:27 Delete

    scotttrade <a href="http://scotttrade.nititigipe.net/">scotttrade</a> craigs list dfw <a href="http://craigs-list-dfw.mimawofot.net/">craigs list dfw</a>

  10. genevieve picot

    Tracked from genevieve picot 2009/10/21 05:08 Delete

    starcraft mods <a href="http://starcraft-mods.amivapuhox.net/">starcraft mods</a> wisconsin public radio <a href="http://wisconsin-public-radio.urycajuc.net/">wisconsin public radio</a>

  11. la mosson rugby hospitality

    Tracked from la mosson rugby hospitality 2009/10/21 06:32 Delete

    victorian spanking <a href="http://victorian-spanking.urycajuc.net/">victorian spanking</a> 58mm camera filter for fujifilm s9600 <a href="http://58mm-camera-filter-for-fujifilm-s9600.nititigipe.net/">58mm camera filter for fujifilm s9600</a>

  12. aa route planner

    Tracked from aa route planner 2009/10/21 07:04 Delete

    oli sykes <a href="http://oli-sykes.ytuzydyzod.net/">oli sykes</a>

  13. Anabolic steroids zyrtec synthroid pravachol aciph

    Tracked from Anabolic steroids zyrtec synthroid pravachol aciph 2009/10/30 23:11 Delete

    Wellbutrin adderall and provigil <a href="http://blogcastrepository.com/members/Wellbutrin-adderall-and-provigil.aspx">Wellbutrin adderall and provigil</a> Propecia hairline <a href="http://blogcastrepository.com/members/Propecia-hairline.aspx">Propeci...

  14. Plavix and tpa

    Tracked from Plavix and tpa 2009/10/31 00:09 Delete

    Renova versus retin a <a href="http://blogcastrepository.com/members/Renova-versus-retin-a.aspx">Renova versus retin a</a> Soma san francisco <a href="http://blogcastrepository.com/members/Soma-san-francisco.aspx">Soma san francisco</a>

  15. Tapering off neurontin

    Tracked from Tapering off neurontin 2009/10/31 01:09 Delete

    Levitra cialis for women <a href="http://blogcastrepository.com/members/Levitra-cialis-for-women.aspx">Levitra cialis for women</a> Keyword celebrex <a href="http://blogcastrepository.com/members/Keyword-celebrex.aspx">Keyword celebrex</a>

  16. Sideffects of premarin

    Tracked from Sideffects of premarin 2009/10/31 02:05 Delete

    Lipitor side effects alternative m d <a href="http://blogcastrepository.com/members/Lipitor-side-effects-alternative-m-d.aspx">Lipitor side effects alternative m d</a> Imitrex oral dream pharmaceutical <a href="http://blogcastrepository.com/members/Imi...

  17. Cipro for lgv

    Tracked from Cipro for lgv 2009/10/31 04:39 Delete

    Zithromax storage <a href="http://blogcastrepository.com/members/Zithromax-storage.aspx">Zithromax storage</a> Glucophage sr <a href="http://blogcastrepository.com/members/Glucophage-sr.aspx">Glucophage sr</a>

Leave a comment
원문 :
보통 순서가 있는 목록 = Ordered List 는 아래와 같이 표현되죠.

[ 예시 1 ]
<ol>
<li>첫번째</li>
<li>두번째</li>
<li>세번째</li>
<li>네번째</li>
<li>다섯번째</li>
</ol>

  1. 첫번째
  2. 두번째
  3. 세번째
  4. 네번째
  5. 다섯번째


<li> 태그에 width나 height를 넣으면 이상한 현상이 나타납니다.
아마도 IE 7 , IE 6 에서 보는 분들은
[ 예시 1 ] 과 다른 모습을 볼 수 있을 것입니다.

[ 예시 2 ]
li {
height: 20px;
}

  1. 첫번째
  2. 두번째
  3. 세번째
  4. 네번째
  5. 다섯번째


[ 해결방법 ]
display: list-item; 을 추가해주면 됩니다.

li {
display: list-item;
height: 20px;
}

  1. 첫번째
  2. 두번째
  3. 세번째
  4. 네번째
  5. 다섯번째


(언제나 신기한 IE.)

Posted by mkyoon

2008/09/29 22:48 2008/09/29 22:48
, , , , , , , ,
Response
No Trackback , No Comment
RSS :
http://mkyoon.com/rss/response/106

Trackback URL : http://mkyoon.com/trackback/106

Leave a comment
원문 :

CSS Limit #1.


하나의 CSS 파일의 크기가
288kb를 넘어설 경우,
인터넷 익스플로러에서는 읽어들이지 못하는 버그가 있다고 합니다.


CSS Limit #2.


CSS 선언. 즉, #selector { } 이러한 스타일 지정 갯수가
4096개를 넘어설 경우,
역시나 인터넷 익스플로러에서 읽어들이지 못하는 버그가 있다고 합니다.


CSS Limit #3.


@import 를 사용하여 여러 CSS 파일을 한 CSS 파일에 모아 관리할 수 있죠.

- style.css -
@import url("style_one.css");
@import url("style_two.css");

이러한 @import 갯수가 32개를 넘어설 경우,
그리고 그 depth 또한 3개의 chain을 넘어설 경우, (style.css>style_one.css>style_ie.css)
또 역시나 인터넷 익스플로러에서 읽어들이지 못하는 버그가 있다고 합니다.

위와 같은 수치 이상으로 늘어나지 않도록,
언제나 조심해야겠습니다.-_-; (언제나 신기한 IE.)

Posted by mkyoon

2008/09/18 18:10 2008/09/18 18:10
, , , , , , ,
Response
No Trackback , 2 Comments
RSS :
http://mkyoon.com/rss/response/105

Trackback URL : http://mkyoon.com/trackback/105

Comments List

  1. 비밀방문자 2009/02/13 15:31 # M/D Reply Permalink

    관리자만 볼 수 있는 댓글입니다.

    1. mkyoon 2009/07/04 14:34 # M/D Permalink

      음..
      일본어로 써놓으시면 제가 알아 먹을리가 없.. -_-;

      Hello!?

Leave a comment

원래 "개, 캐" 라는 접두어를 싫어한다. (내가 개띠라서 그런거 절대 아니;;)
하지만 정말 사용 안할래야 안할 수가 없는 동감 백배천배만배의 글을 보고야 말았으니-

나를 미치게 하는 PNG - http://html.nhndesign.com/blog/?p=142

어흑 -_ㅠ

ps.
여기에 IE 버그를 더하자면.
AlphaImageLoader를 사용하면 링크가 안먹힌다는거~

Posted by mkyoon

2008/04/01 12:36 2008/04/01 12:36
, , , ,
Response
No Trackback , No Comment
RSS :
http://mkyoon.com/rss/response/91

Trackback URL : http://mkyoon.com/trackback/91

Leave a comment

IE에서 지원되는 CSS 목록은 다음에서 확인할 수 있다.

<select>  http://msdn2.microsoft.com/en-us/library/ms535893.aspx
<option>  http://msdn2.microsoft.com/en-us/library/ms535877.aspx

그리고 다음 문구도 확인할 수 있다.
- option Object Remarks -
Except for background-color and color, style settings applied through the style object for the option element are ignored. In addition, style settings applied directly to individual options override those applied to the containing SELECT element as a whole.
option 엘리먼트에는 오직 배경색과 글씨색만 바꿀 수 있다는 얘기다.
그래. 원래 IE에는 기대조차 안하고 있었으니 그렇다 치자.

하지만 "신기한" 현상을 목격해버렸..-_-
예제 파일을 만들어 보았으니 같이 함 보십시다.

- 예제 File Link 1 - select_euckr.html (ASCII / EUC-KR)
- 예제 File Link 2 - select_utf8.html (UTF-8)

두개의 문서의 차이는 단 하나. 인코딩-_-

select_euckr.html은 저장할 때 파일형식을 ASCII (notepad에선 ANSI)로 저장했고
select_utf8.html은 저장할 때 파일형식을 UTF-8로 저장했다.
물론 각각 character set(EUC-KR, UTF-8)도 알맞게 넣었다.

그럼 소스코드를 확인해보자.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr 또는 utf-8" />
<title>ASCII / EUC-KR 또는 UTF-8</title>
<style type="text/css">
body { font-family: Tahoma; }
select {
width: 120px;
height: 200px;
padding: 5px;
background: #ff0;
color: #f00;
font-family: Dotum;
font-size: 12px;
line-height: 2em;
}
option.test {
height: 20px;
margin: 5px;
padding: 10px;
background: #000 url(http://mkyoon.tomeii.com/mstar.gif) no-repeat 0 0;
color: #0ff;
font-family: Gungsuh;
font-size: 16px;
line-height: 2em;
}
</style>
</head>
<body>
<h1>EUC-KR 또는 UTF-8</h1>
<select size="5">
<option>IE 좀맞을래연</option>
<option class="test">IE 좀맞을래연</option>
<option>IE 좀맞을래연</option>
<option class="test">IE 좀맞을래연</option>
<option>IE 좀맞을래연</option>
<option>IE 좀맞을래연</option>
<option>IE 좀맞을래연</option>
<option>IE 좀맞을래연</option>
<option>IE 좀맞을래연</option>
<option class="test">IE 좀맞을래연</option>
<option>IE 좀맞을래연</option>
<option class="test">IE 좀맞을래연</option>
<option>IE 좀맞을래연</option>
<option>IE 좀맞을래연</option>
<option>IE 좀맞을래연</option>
<option>IE 좀맞을래연</option>
<option>IE 좀맞을래연</option>
</select>
</body>
</html>

두개 링크를 각각 IE(6,7다 똑같음-_-)와 FF에서 열어보면 다음과 같다.

- IE -
IE - ASCII EUC-KRIE - UTF-8
스타일 먹은거라곤
select : background-color, color, font-family, font-size, height, width
object : background-color, color 끝.

- FF -
FF - ASCII EUC-KRFF - UTF-8
select : background, color, font-family, font-size, height, line-height, padding, width
object : background, color, font-family, font-size, height, line-height, margin, padding
스타일 다 먹어주시고~ 훗-_-

여기서 끝이 아니라.
IE 스크린샷을 한번 보자. 뭔가 이상하지 않은가.
문서 인코딩 형식을 바꿨다고 저렇게 줄간격이 바뀌어도 되는건가?
IE에선 option은 height도 line-height도 안먹는단 말이다!

이건 뭥미?

IE는 utf-8 인코딩에서 문자 높이가 작아지는 현상이 있다고 한다.
결국 select 폰트크기를 좀더 크게 하여 해결함.

Posted by mkyoon

2008/03/29 17:40 2008/03/29 17:40
, , , , , , , ,
Response
No Trackback , No Comment
RSS :
http://mkyoon.com/rss/response/90

Trackback URL : http://mkyoon.com/trackback/90

Leave a comment
« Previous : 1 : 2 : 3 : 4 : Next »