CMS솔루션마켓, 이온디 - 워드프레스, 라이믹스, 카페24, 그누보드, 엑셀

프리랜서 커뮤니티

원래 스크롤을 목적으로 한 태그 <marquee 에 대해
최근에 보이던 스크롤 일시정지..같은 기술을 어떻게 쓸 수 있을까..하다가 만들어본 내용입니다.

...


<marquee width=100 height=100 direction=left behavior=alternate onmouseover="var v=this, w=v.scrollAmount, x=v.scrollDelay; this.onmouseout=function(){v.scrollAmount=w; v.scrollDelay=x;}; v.scrollAmount=0; v.scrollDelay=10000; ">
<table border=0 cellpadding=0 cellspacing=0 width=400><tr height=100><td width=50 bgcolor=gray>1</td><td width=50 bgcolor=blue>2</td><td width=50 bgcolor=gray>3</td><td width=50 bgcolor=blue>4</td><td width=50 bgcolor=gray>5</td><td width=50 bgcolor=blue>6</td><td width=50 bgcolor=gray>7</td><td width=50 bgcolor=blue>8</td></tr></table>
</marquee>


...


12345678



...

함수를 직접 값을 조정하는 것도 좋겠지만, 
뭐랄까요.. 기존 값이 변경됐을 땐 어떻게 해야할지 준비를 하는 쪽으로 선택했죠.

*참고*
위의 경우에는 "on--=" 이벤트를 썼습니다만,
실제 적용할 땐 script 로 따로 저장해놓는 것이 좋을겁니다.
함수 선언하면서 메모리를 잡아먹(?)거든요..

..라고 적었는데 OTL.. Opera 쪽에서는 작동을 안하는군요.
(marquee 의 scrollAmount 와 scrollDelay 값이 읽히지 않더라구요.)

...

별 수 없이(?) default 값이 있다..라고 가정시키는 형태로 
다시 풀어봅니다.

...


<marquee width=100 height=100 direction=left behavior=alternate onmouseover="var v=this, w=v.scrollAmount, x=v.scrollDelay; this.onmouseout=function(){v.scrollAmount=w?w:6; v.scrollDelay=x?x:85;}; v.scrollAmount=0; v.scrollDelay=10000; ">
<table border=0 cellpadding=0 cellspacing=0 width=400><tr height=100><td width=50 bgcolor=gray>1</td><td width=50 bgcolor=blue>2</td><td width=50 bgcolor=gray>3</td><td width=50 bgcolor=blue>4</td><td width=50 bgcolor=gray>5</td><td width=50 bgcolor=blue>6</td><td width=50 bgcolor=gray>7</td><td width=50 bgcolor=blue>8</td></tr></table>
</marquee>


...

12345678



...

smallLet killofki@.

추천한 사람