[Script] marquee 태그 위에 마우스 올렸을 때 자동스크롤 일시정지.. event
2014.02.11 19:28
4057
0
https://eond.com/348824
object(HotopayModel)#857 (23) { ["error"]=> int(0) ["message"]=> string(7) "success" ["variables"]=> array(0) { } ["httpStatusCode"]=> int(200) ["module"]=> string(7) "hotopay" ["module_info"]=> NULL ["origin_module_info"]=> NULL ["module_config"]=> NULL ["module_path"]=> string(52) "/home/eond/web/eond.com/public_html/modules/hotopay/" ["xml_info"]=> NULL ["module_srl"]=> NULL ["mid"]=> NULL ["act"]=> NULL ["template_path"]=> NULL ["template_file"]=> NULL ["layout_path"]=> NULL ["layout_file"]=> NULL ["edited_layout_file"]=> NULL ["stop_proc"]=> bool(false) ["user"]=> object(Rhymix\Framework\Helpers\SessionHelper)#867 (20) { ["member_srl"]=> int(0) ["user_id"]=> NULL ["user_name"]=> NULL ["nick_name"]=> NULL ["email_address"]=> NULL ["phone_number"]=> NULL ["homepage"]=> NULL ["blog"]=> NULL ["birthday"]=> NULL ["denied"]=> NULL ["status"]=> NULL ["is_admin"]=> string(1) "N" ["is_site_admin"]=> NULL ["profile_image"]=> NULL ["image_name"]=> NULL ["image_mark"]=> NULL ["signature"]=> NULL ["description"]=> NULL ["group_list"]=> array(0) { } ["menu_list"]=> array(0) { } } ["request"]=> object(Rhymix\Framework\Request)#10 (13) { ["method"]=> string(3) "GET" ["compat_method"]=> string(3) "GET" ["url"]=> string(28) "coding/348824/comment/465133" ["hostname"]=> string(8) "eond.com" ["domain"]=> NULL ["protocol"]=> string(5) "https" ["callback_function"]=> string(0) "" ["_route_status":protected]=> int(200) ["_route_options":protected]=> object(stdClass)#11 (5) { ["cache_control"]=> bool(true) ["check_csrf"]=> bool(true) ["is_forwarded"]=> bool(false) ["is_indexable"]=> bool(true) ["enable_session"]=> bool(true) } ["module"]=> string(5) "board" ["mid"]=> string(6) "coding" ["act"]=> string(16) "dispBoardContent" ["args"]=> array(5) { ["category"]=> string(5) "20255" ["document_srl"]=> string(6) "348824" ["comment_srl"]=> string(6) "465133" ["mid"]=> string(6) "coding" ["act"]=> string(16) "dispBoardContent" } } ["ajaxRequestMethod"]=> array(2) { [0]=> string(6) "XMLRPC" [1]=> string(4) "JSON" } ["gzhandler_enable"]=> bool(true) }

원래 스크롤을 목적으로 한 태그 <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@.

라이믹스는 이온디와 함께

HTML5/CSS3
-
+
닫기

마이페이지

로그인을 해주세요

네이버로 로그인