´Ù¿î·Îµå ÆÄÀÏ¿¡´Â ¿¹Á¦ÆÄÀÏ°ú ¼Ò½ºÆÄÀÏÀ» ¾ÐÃàÇÏ¿© ³õ¾Ò½À´Ï´Ù. ¾Æ·¡´Â ¼³¸íºÎºÐÀÔ´Ï´Ù.
°¢ ¹öÆ°À» Ŭ¸¯Çϸé ȸéÀÌ ¹Ì²ô·¯ÁöµíÀÌ È¸éÀÌ ¹Ù²î¸é¼ À̹ÌÁö°¡ º¸¿©Áý´Ï´Ù.
À̹ÌÁö¿Í ±×¸²°ú °°ÀÌ Ãâ·ÂµÇ´Â ±ÛÀÚ ³ª¿À´Â ºÎºÐÀº ¾ÆÀÌÇÁ·¹ÀÓ Å±׷ΠºÒ·¯µé¿©Áö´Â ¶Ç ´Ù¸¥ HTML ¹®¼ÀÔ´Ï´Ù. ¿¹Á¦¿¡¼´Â ÆíÀÇ»ó, ¾ÆÀÌÇÁ·¹ÀÓ ¾È¿¡ µé¾î°¡´Â ¹®¼´Â contents.html À̶óÇÏ°í, ¹öÆ°ÀÌ µé¾î°¡´Â ¹®¼´Â demo_sliding.html À̶ó°í À̸§ ºÙÀÌ°Ú½À´Ï´Ù.
¸ÕÀú, contents.html °ú demo_sliding.html À̶ó´Â À̸§À¸·Î »õ HTML¹®¼ µÎ°³¸¦ ¸¸µé¾î µÓ´Ï´Ù.
¸ÕÀú ¾ÆÀÌÇÁ·¹ÀÓ ¾È¿¡ µé¾î°¡´Â ¹®¼ÀÎ contents.htmlÀ» ¸¸µé¾î º¸µµ·Ï ÇÕ´Ï´Ù.
-------------------------------------------------------------------------------- 1.contents.html ÀÇ <body>¿Í </body> »çÀÌ¿¡ ¾Æ·¡¿Í °°Àº Å×À̺í Çϳª¸¦ ¸¸µì´Ï´Ù. -------------------------------------------------------------------------------- <table width="2500" height="200" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="500"><img src="img/img1.jpg" align="left">¡¡- À̹ÌÁö1</td> <td width="500"><img src="img/img2.jpg" align="left">¡¡- À̹ÌÁö2</td> <td width="500"><img src="img/img3.jpg" align="left">¡¡- À̹ÌÁö3</td> <td width="500"><img src="img/img4.jpg" align="left">¡¡- À̹ÌÁö4</td> <td width="500"><img src="img/img5.jpg" align="left">¡¡- À̹ÌÁö5</td> </tr> </table> -------------------------------------------------------------------------------- Å×À̺í ÇÑÄÀÇ °¡·ÎÅ©±â¸¦ 500À¸·Î ¼³Á¤ÇÏ¿´½À´Ï´Ù. ÃÑ 5°³ÀÇ ÄÀ¸·Î ±¸¼ºÇÏ¿´½À´Ï´Ù. Áï,500x5=2500 ÀÇ Å×ÀÌºí °¡·ÎÅ©±â°¡ µÇ´Â °ÍÀÔ´Ï´Ù.
°¡·ÎÅ©±â 500Àº ¾ÆÀÌÇÁ·¹ÀÓ °¡·ÎÅ©±â¿¡ ¸ÂÃç¼ È¸é¿¡ º¸¿©Áö´Â À̹ÌÁöÀÇ °¡·Î Å©±â¸¦ ¼³Á¤ÇÑ °ÍÀÔ´Ï´Ù.
[¢Ñ contents.htmlÀ» ´Ù ¸¸µé¸é ¿·À¸·Î ±ä Å×À̺íÀÇ ¹®¼°¡ ¸¸µé¾î Áý´Ï´Ù.]
ÀÌÁ¦ ¹öÆ°¿¡ ÇØ´çÇÏ´Â ¹®¼ demo_sliding.html ¹®¼¸¦ ¸¸µé¾î º¸°Ú½À´Ï´Ù.
-------------------------------------------------------------------------------- 2. demo_sliding.html ¹®¼¾ÈÀÇ <head>¿Í </head>»çÀÌ¿¡ ¾Æ·¡ ÀÚ¹Ù½ºÅ©¸³Æ® ¼Ò½º¸¦ »ðÀÔÇÕ´Ï´Ù. -------------------------------------------------------------------------------- <script language="JavaScript"> <!-- var x = 0; var dest = 0; var distance = 0; var step = 0; var destination = 0;
function scrollit(destination) { step = 1; //½ºÅ©·Ñ¼Óµµ¿Í °ü°è: ¼ýÀÚ°¡ Ŭ¼ö·Ï ¼Óµµ ºü¸§ dest = destination; if (x<dest) { while (x<dest) { step += (step / 50); //½ºÅ©·Ñ¼Óµµ¿Í °ü°è: ¼ýÀÚ°¡ Ŭ¼ö·Ï ¼Óµµ ´À¸² x += step; this.frames.iscrollx.scroll(x,0); } this.frames.iscrollx.scroll(dest,0); x = dest; }
if (x > dest) { while (x>dest) { step += (step / 50); //½ºÅ©·Ñ¼Óµµ¿Í °ü°è: ¼ýÀÚ°¡ Ŭ¼ö·Ï ¼Óµµ ´À¸² if(x >= (0+step)) { x -= step; this.frames.iscrollx.scroll(x,0); } else { break; } } if(dest >= 0) { this.frames.iscrollx.scroll(dest,0); } x = dest; } if (x<1) {x=1} if (x>3000) {x=2500} // 3000 À̶ó°í ½áÁø ºÎºÐ¿¡´Â 'contents.html ÀÇ Å×À̺íÀÇ Æø + contents.html ÀÇ ¼¿ ÇÑ°³ÀÇ Æø' À» Àû¾îÁÖ½Ã¸é µË´Ï´Ù. } // contents.html ÀÇ Å×À̺íÀÇ ÆøÀº 2500 À̾ú°í ¼¿ ÇÑ°³´ç ÆøÀÌ 500À̾úÀ¸¹Ç·Î [2500+500=3000] //--> </script> -------------------------------------------------------------------------------- À§ ¼Ò½º ³»¿ëÁß¿¡ ¼ýÀÚ·Î µÇ¾îÀÖ´Â 2, 50 ,50Àº °¢°¢ ½ºÅ©·Ñ¼Óµµ¿Í °ü°è°¡ ÀÖ½À´Ï´Ù. 2´Â Å« ¼öÀϼö·Ï ºü¸£°í, 50À̶ó°í ½áÁø ºÎºÐÀº Á¿ìÃø À̹ÌÁö°¡ ½ºÅ©·ÑµÉ ¶§ÀÇ ¼Óµµ¸¦ °¢°¢ ¼³Á¤ÇÏ´Â ºÎºÐÀÌ°í, ³ª´©¾îÁö´Â °ªÀ̱⠶§¹®¿¡ ¼ýÀÚ°¡ Å« ¼öÀÏ·Ï ¼Óµµ°¡ ´À¸³´Ï´Ù.
iscrollx ´Â ¹öÆ°À» Ŭ¸¯ÇßÀ» ¶§ ¾î¶² ÇÁ·¹ÀÓÀÇ È¸éÀ» ½ºÅ©·Ñ ½Ãų±î¸¦ Á¤ÇØÁÖ´Â ºÎºÐÀÔ´Ï´Ù. ¿©±â¼´Â Àá½Ã ÈÄ¿¡ ¾ÆÀÌÇÁ·¹ÀÓÀÇ À̸§À» iscrollx ¶ó°í ÇÒ °ÍÀ̹ǷΠÀú·¸°Ô ºÙ¿´½À´Ï´Ù.
3000 À̶ó°í ¾²¿©Áø ºÎºÐ¿¡´Â 'contents.html ¹®¼¾È¿¡ ¸¸µé¾îÁø Å×À̺íÀÇ Àüü °¡·ÎÆø + 'contents.html ¹®¼¾È¿¡ ¸¸µé¾îÁø Å×À̺í ÇÑÄÀÇ Æø' À» Àû¾îÁÖ½Ã¸é µË´Ï´Ù. contents.html ¹®¼¾È¿¡ ¸¸µé¾îÁø Å×À̺íÀÇ Àüü °¡·ÎÆøÀº 2500 À̾ú°í, Å×À̺í ÇÑ ÄÀÇ °¡·ÎÅ©±â°¡ 500 À̾úÀ¸¹Ç·Î [2500 + 500 = 3000 ] ÀÔ´Ï´Ù.
2500 Àº ¾Õ¿¡¼ contents.html ¹®¼¾È¿¡ ¸¸µé¾îÁø Å×À̺íÀÇ Àüü °¡·ÎÆø°ú °°Àº ¼öÄ¡¸¦ Àû¾îÁÖ½Ã¸é µË´Ï´Ù.
-------------------------------------------------------------------------------- 3. demo_sliding.html ÀÇ <body>¿Í </body>»çÀÌ¿¡ ¾Æ·¡Ã³·³ ¾ÆÀÌÇÁ·¹ÀÓ°ú ¹öÆ°À» ¸¸µì´Ï´Ù. -------------------------------------------------------------------------------- <iframe src="contents.html" frameborder="0" name="iscrollx" width="500" height="200" marginwidth="0" marginheight="0" scrolling="no"></iframe> <br>
<a href='javascript:scrollit(0);'>À̹ÌÁö1</a> <a href='javascript:scrollit(500);'>À̹ÌÁö2</a> <a href='javascript:scrollit(1000);'>À̹ÌÁö3</a> <a href='javascript:scrollit(1500);'>À̹ÌÁö4</a> <a href='javascript:scrollit(2000);'>À̹ÌÁö5</a> -------------------------------------------------------------------------------- ¾ÆÀÌÇÁ·¹ÀÓ °¡·ÎÅ©±â¸¦ contents.html ¹®¼¾È¿¡ ¸¸µé¾îµÐ Å×À̺í ÇÑ°³ÀÇ °¡·ÎÆø(500Çȼ¿)°ú ¸ÂÃß¾î¼ 500Çȼ¿·Î ¼³Á¤ÇÏ°í, ¼¼·ÎÅ©±â¸¦ À̹ÌÁö°¡ ¿ÏÀüÈ÷ º¸À̵µ·Ï Á¤µµÀÇ Å©±â(¿©±â¼´Â 200Çȼ¿·Î ¼³Á¤)¸¦ ¼³Á¤ÇÏ¿´½À´Ï´Ù.
¾Æ! ±×¸®°í, ¾ÆÀÌÇÁ·¹ÀÓÀ¸·Î Ãâ·ÂµÇ´Â ¹®¼ÀÇ °æ·Î´Â »ó´ë°æ·Î·Î ÁöÁ¤ÇÏ¼Å¾ß ÀÚ¹Ù½ºÅ©¸³Æ® ¿À·ù¾øÀÌ ½ÇÇàÀÌ µË´Ï´Ù. Àý´ë°æ·Î·Î Çغ¸´Ï±î. ¿À·ù°¡ ³ª´õ±º¿ä...^^;
ÀÌÁ¦, demo_sliding.html ¹®¼¸¦ ½ÇÇàÇÏ¿©¼ °¢°¢ÀÇ [À̹ÌÁö] ¹öÆ°À» Ŭ¸¯ÇÏ¿©¼ È®ÀÎÇغ¸¼¼¿ä...^^
[¢Ñ demo_sliding.html ¹®¼¸¦ Ŭ¸¯Çϼż È®ÀÎÇغ¸¼¼¿ä]
|