J

window.onload=() 를 대체할만한..php코드는 없나요?

J.Mando
· 22년 전 · 4263 · 2
아니구나 말을 잘못했어요...

스크롤배너 만든거 자바스크립트땜시

화면을 주이거나 늘리기만해도

리프레쉬가 되가땜시 미티겠어요..

그거만 해결되면 좋은 소스인데......

<?
// 기본설정
$s_x = 0; // 가로위치
$s_y = 0; // 세로위치
$s_w = 120; // 가로길이
$s_h = 60; // 세로길이
$s_b = 0; // 테두리크기
$s_p = 0; // 패딩 크기
$c_bg = ""; // 배경색
$c_bd = ""; // 테두리색
$c_fg = ""; // 글씨색
$f_date = 10; // 날짜 글씨 크기 (픽셀)
$f_sub = 12; // 글씨 크기 (픽셀)
$delay = 3000; // 메세지 사이에 멈출 시간 (밀리세컨드)
// 이 아래부분은 조심해서 수정하세요.
?>

<? if (count($list) == 0) { echo "No Data"; }
else { ?>
<div id="tempholder"></div>
<script language="JavaScript" src="<?=$latest_skin?>/dhtmllib.js"></script>
<script language="JavaScript" src="<?=$latest_skin?>/scroller.js"></script>
<script language="JavaScript">
/*
Mike's DHTML scroller (By Mike Hall)
마지막 업데이트 : 2002년 6월 21일 by Dynamic Drive - NS6 호환
번역 : 2003년 11월 3일 by kimzz.com
*/

// 스크롤러의 모양과 색 선택, 메세지
var myScroller1 = new Scroller(<?=$s_x?>, <?=$s_y?>, <?=$s_w?>, <?=$s_h?>, <?=$s_b?>, <?=$s_p?>); //(x값, y값, 가로, 세로, 테두리, 패딩)
myScroller1.setColors("<?=$c_fg?>", "<?=$c_bg?>", "<?=$c_bd?>"); //(전경색, 배경색, 테두리색)
myScroller1.setFont("Verdana,Arial,Helvetica", 2);
<? for ($i=0; $i<count($list); $i++) { ?>
myScroller1.addItem("<?=$list[$i][file1_ban]?>");
<? } ?>
// 스크롤러 멈춤값 설정
myScroller1.setPause(<?=$delay?>); //메세지 사이에 멈출 시간 (밀리세컨드)
function runmikescroll() {

var layer;
var mikex, mikey;

// Locate placeholder layer so we can use it to position the scrollers.

layer = getLayer("placeholder");
mikex = getPageLeft(layer);
mikey = getPageTop(layer);

// Create the first scroller and position it.

myScroller1.create();
myScroller1.hide();
myScroller1.moveTo(mikex, mikey);
myScroller1.setzIndex(100);
myScroller1.show();
}

window.onload=runmikescroll <=== 이부분을 대체 할만한건 업나요?
</script>
<div id="placeholder" style="position:relative; width:<?=$s_w?>px; height:<?=$s_h?>px;"> </div>
<? } ?>

소스입니다
|

댓글 2개

JJ.Mando
22년 전
감사합니다..
scroller.js 파일 中에서... 맨 끝부분 보면...
----------------------------------------
window.onresize = scrollerReload;
function scrollerReload() {
// Reload page in case of a browser resize. First make sure it's a true
// resize.
if (isMinNS4 && origWidth == window.innerWidth && origHeight == window.innerHeight)
return;
window.location.href = window.location.href;
}
---------------------------------
이부분과 관련된거 같은데요...
scrollerReload()를 주석처리해보니 윈도우사이즈 조정해도 리로드 안합니다..

원래 저 소스부분이 왜 있는지 아는게 전혀 없어서...
주석처리해도 되는건지는 모릅니다...

* 컴초보&그누보드3일째사용&취약과목=작문... 따라서 되묻기 나오면...
무조건 도망
댓글을 작성하시려면 로그인이 필요합니다. 로그인

자유게시판

+
제목 글쓴이 날짜 조회
22년 전 조회 4,171
22년 전 조회 3,789
22년 전 조회 4,165
22년 전 조회 3,697
22년 전 조회 3,469
22년 전 조회 4,079
22년 전 조회 3,663
22년 전 조회 3,910
22년 전 조회 4,075
재경아빠
22년 전 조회 3,960
22년 전 조회 4,134
22년 전 조회 4,286
재경아빠
22년 전 조회 4,668
22년 전 조회 3,544
JJ.Mando
22년 전 조회 4,264
JJ.Mando
22년 전 조회 3,887
22년 전 조회 3,554
22년 전 조회 3,663
22년 전 조회 3,815
22년 전 조회 3,594
22년 전 조회 3,606
JJ.Mando
22년 전 조회 3,922
22년 전 조회 3,828
&&nbsp;&nbsp;
22년 전 조회 3,490
22년 전 조회 3,416
&&nbsp;&nbsp;
22년 전 조회 3,766
22년 전 조회 3,575
22년 전 조회 3,820
22년 전 조회 4,538
22년 전 조회 5,007
🐛 버그신고