http://oxtag.com/html/ex/ex/ex8.html

  1. <html>
  2. <head>
  3. <title>이미지에 섬광 효과 주기</title>
  4. <style><!--
  5. #spotlight {filter:light}
  6. --></style>
  7. <meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
  8. </head>
  9. <body>
  10. <p align="center"><font color="red" size="2"><b>이미지에 섬광 효과 주기</b></font><P><span
  11. style="font-size:9pt;"><IMG height=30 src="http://oxtag.com/html/img/banner/jjin_tagpia.gif" width=90> 스크립트 적용 전</span></P>
  12. <P><span style="font-size:9pt;"><IMG id=spotlight height=30 src="http://oxtag.com/html/img/banner/jjin_tagpia.gif" width=90 speed="50"> 스크립트 적용
  13. </span></P>
  14. <P><span style="font-size:9pt;">마치 어두운 밤에 여기저기 손전등을 비추는 듯, 평범한 이미지에 섬광효과를 줍니다.</span></P>
  15. <p class="tip-dot-line-table"><span style="font-size:9pt;">&nbsp;</span></p>
  16. <P><span style="font-size:9pt;">&lt;head&gt;&lt;/head&gt; 아래 소스를 넣어 줍니다.</span></P>
  17. <P><span style="font-size:9pt;">&nbsp;</span></P>
  18. <P><FONT class=tip-tag-font color="blue"><span style="font-size:9pt;">&lt;style&gt;&lt;!--</span></FONT></P>
  19. <P><FONT class=tip-tag-font color="blue"><span style="font-size:9pt;">#spotlight {filter:light}</span></FONT></P>
  20. <P><FONT class=tip-tag-font color="blue"><span style="font-size:9pt;">--&gt;&lt;/style&gt;</span></FONT></P>
  21. <p class="tip-dot-line-table"><span style="font-size:9pt;">&nbsp;</span></p>
  22. <P><span style="font-size:9pt;">&lt;body&gt;&lt;/body&gt; 사이에 아래와 같은 식으로 이미지 태그 안에 <b>id=&quot;spotlight&quot;
  23. speed=&quot;50&quot;</b> 를 추가합니다.</span></P>
  24. <P><FONT class=tip-tag-font color="blue"><span style="font-size:9pt;">&lt;img<B> id=</B>&quot;<B>spotlight</B>&quot;<B>
  25. speed=</B>&quot;<B>50</B>&quot; src=&quot;</FONT><font color="blue">http://oxtag.com/html/img/banner/jjin_tagpia.gif</font><FONT class=tip-tag-font color="blue">&quot;&gt;</span></FONT></P>
  26. <P><span style="font-size:9pt;">50 은 속도. 큰 수일수록 속도 느림</span></P>
  27. <p class="tip-dot-line-table"><span style="font-size:9pt;">&nbsp;</span></p>
  28. <P><B><span style="font-size:9pt;">&lt;/body&gt; 바로 앞</B>에 아래 소스를 넣어 줍니다.</span></P>
  29. <P><FONT class=tip-tag-font color="blue"><span style="font-size:9pt;">&lt;script language=&quot;JavaScript1.2&quot;&gt;</span></FONT></P>
  30. <P><FONT class=tip-tag-font color="blue"><span style="font-size:9pt;">/*<BR>Moving light on image script<BR>?Dynamic Drive
  31. (www.dynamicdrive.com)<BR>For full source code, installation
  32. instructions,<BR>100's more DHTML scripts, and Terms Of<BR>Use, visit
  33. dynamicdrive.com<BR>*/</span></FONT></P>
  34. <P><FONT class=tip-tag-font color="blue"><span style="font-size:9pt;"><BR>if
  35. (document.all&amp;&amp;window.spotlight){<BR>var x=new Array()<BR>var
  36. direction=new Array()<BR>var y=new Array()<BR>if
  37. (spotlight.length==null){<BR>spotlight[0]=document.all.spotlight<BR>x[0]=0<BR>direction[0]=&quot;right&quot;<BR>y[0]=spotlight[0].height<BR>spotlight[0].filters.light.addPoint(100,50,100,255,255,255,90)<BR>}<BR>else<BR>for
  38. (i=0;i&lt;spotlight.length;i++){<BR>x[i]=0<BR>direction[i]=&quot;right&quot;<BR>y[i]=spotlight[i].height<BR>spotlight[i].filters.light.addPoint(100,50,100,255,255,255,90)<BR>}<BR>}</span></FONT></P>
  39. <P><FONT class=tip-tag-font color="blue"><span style="font-size:9pt;">function
  40. slidelight(cur){<BR>spotlight[cur].filters.light.MoveLight(0,x[cur],y[cur],200,-1)</span></FONT></P>
  41. <P><FONT class=tip-tag-font color="blue"><span style="font-size:9pt;">if
  42. (x[cur]&lt;spotlight[cur].width+200&amp;&amp;direction[cur]==&quot;right&quot;)<BR>x[cur]+=10<BR>else
  43. if
  44. (x[cur]&gt;spotlight[cur].width+200){<BR>direction[cur]=&quot;left&quot;<BR>x[cur]-=10<BR>}<BR>else
  45. if
  46. (x[cur]&gt;-200&amp;&amp;x[cur]&lt;-185){<BR>direction[cur]=&quot;right&quot;<BR>x[cur]+=10<BR>}<BR>else{<BR>x[cur]-=10<BR>direction[cur]=&quot;left&quot;<BR>}<BR>}</span></FONT></P>
  47. <P><FONT class=tip-tag-font color="blue"><span style="font-size:9pt;">if (document.all&amp;&amp;window.spotlight){<BR>if
  48. (spotlight.length==null)<BR>setInterval(&quot;slidelight(0)&quot;,spotlight[0].speed)<BR>else<BR>for
  49. (t=0;t&lt;spotlight.length;t++){<BR>var
  50. temp='setInterval(&quot;slidelight('+t+')&quot;,'+spotlight[t].speed+')'<BR>eval(temp)<BR>}<BR>}<BR>&lt;/script&gt;</span></FONT></P>
  51. <p><FONT class=tip-tag-font color="blue"><span style="font-size:9pt;">&nbsp;</span></FONT></p>
  52. <p><FONT class=tip-tag-font color="blue"><span style="font-size:9pt;">&nbsp;</span></FONT></p>
  53. <script language="JavaScript1.2">
  54. /*
  55. Moving light on image script
  56. ?Dynamic Drive (www.dynamicdrive.com)
  57. For full source code, installation instructions,
  58. 100's more DHTML scripts, and Terms Of
  59. Use, visit dynamicdrive.com
  60. */
  61. if (document.all&&window.spotlight){
  62. var x=new Array()
  63. var direction=new Array()
  64. var y=new Array()
  65. if (spotlight.length==null){
  66. spotlight[0]=document.all.spotlight
  67. x[0]=0
  68. direction[0]="right"
  69. y[0]=spotlight[0].height
  70. spotlight[0].filters.light.addPoint(100,50,100,255,255,255,90)
  71. }
  72. else
  73. for (i=0;i<spotlight.length;i++){
  74. x[i]=0
  75. direction[i]="right"
  76. y[i]=spotlight[i].height
  77. spotlight[i].filters.light.addPoint(100,50,100,255,255,255,90)
  78. }
  79. }
  80. function slidelight(cur){
  81. spotlight[cur].filters.light.MoveLight(0,x[cur],y[cur],200,-1)
  82. if (x[cur]<spotlight[cur].width+200&&direction[cur]=="right")
  83. x[cur]+=10
  84. else if (x[cur]>spotlight[cur].width+200){
  85. direction[cur]="left"
  86. x[cur]-=10
  87. }
  88. else if (x[cur]>-200&&x[cur]<-185){
  89. direction[cur]="right"
  90. x[cur]+=10
  91. }
  92. else{
  93. x[cur]-=10
  94. direction[cur]="left"
  95. }
  96. }
  97. if (document.all&&window.spotlight){
  98. if (spotlight.length==null)
  99. setInterval("slidelight(0)",spotlight[0].speed)
  100. else
  101. for (t=0;t<spotlight.length;t++){
  102. var temp='setInterval("slidelight('+t+')",'+spotlight[t].speed+')'
  103. eval(temp)
  104. }
  105. }
  106. </script>
  107. </body>
  108. </html>
Posted by 알 수 없는 사용자
,