¾È±Ô °øºÎ¹æ

Javascript & JQuery & CSS > ¸ð¹ÙÀÏÀ¥ - ÁÖ¼Òâ ÀÚµ¿ ¼û±è ½ºÅ©¸³Æ®

µî·ÏÀÏ : 2017-07-18 10:51 Á¶È¸¼ö : 53,229

scroll2Top()Àº ÆäÀÌÁö ·Îµù Áß ½ºÅ©·ÑÀÌ ÀÌ¹Ì ³»·Á°£ °æ¿ì 

ÆäÀÌÁö ·ÎµùÀÌ ³¡³ª°í ÆäÀÌÁö ÃÖ»ó´ÜÀ¸·Î ½ºÅ©·ÑÀÌ ÃʱâÈ­ µÇ´Â °ÍÀ» ¹æÁöÇÑ´Ù.
 

	function scroll2Top()
	{
		var fn = function()
		{
			var top = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop;
			if(top === 0)
			{
				window.setTimeout(scrollTo, 0, 0, 1);
			}
		};

		window.setTimeout(fn, 500);
	}

	 

	if(window.attachEvent)
	{
		window.attachEvent("load", scroll2Top);
	}
	else
	{
		window.addEventListener("load", scroll2Top);
	}
		 
if(window.attachEvent) ¸¦ »ç¿ëÇÏ´Â ÀÌÀ¯´Â IE¿¡¼­ window.addEventListener ¸®½º³Ê°¡ °æ°íÇ¥½Ã µÈ´Ù.

ÆäÀÌÁöÀÇ ¹®Á¦´Â ¾øÁö¸¸ IE¿¡¼­ º¼ ¶§ ½Å°æ¾²À̹ǷΠ¿¹¿Ü󸮸¦ ÇØÁØ´Ù.

ºñ IE ºê¶ó¿ìÀú¿¡¼­´Â ÇØ´ç»çÇ×ÀÌ ¾ø´Ù.



 
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.