상세 컨텐츠

본문 제목

플래쉬 레이어 - 브라우져 리사이즈, 스크롤시 포지션 변경 소스

프로그래밍/스크립트

by 라제폰 2009. 2. 6. 16:49

본문

<div id="eventLayer" style="position:absolute; left:850px; top:300px; z-index:999">
 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="250" height="195" id="0825EventSubFlashPop" align="middle">
  <param name="allowScriptAccess" value="sameDomain" />
  <param name="movie" value="/event/2005_08/han_0824/0825EventSubFlashPop.swf<%=han_param%>" />
  <param name="quality" value="high" />
  <param name="bgcolor" value="#ffffff" />
  <param name="wmode" value="transparent">
  <embed src="/event/2005_08/han_0824/0825EventSubFlashPop.swf" quality="high" bgcolor="#ffffff" width="250" height="195" name="0825EventSubFlashPop" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
 </object>
</div>

<script language="javascript">
<!--
var event_div_top       = 0;
var event_div_left      = 0;
var event_div_width     = 250;
var event_div_height    = 195;

function event_div_position()
{
    event_div_top   = document.body.scrollTop + document.body.clientHeight - event_div_height;
    event_div_left  = document.body.clientWidth - event_div_width;

    document.all.eventLayer.style.top   = event_div_top;
    document.all.eventLayer.style.left  = event_div_left;
}

onload = event_div_position;

var old_ResizeHandler = window.onresize;
window.onresize = new Function("{if (old_ResizeHandler != null) old_ResizeHandler(); event_div_position();}");

var old_ScrollHandler = window.onscroll;
window.onscroll = new Function("{if (old_ScrollHandler != null) old_ScrollHandler(); event_div_position();}");


관련글 더보기