스크롤 최신글 이동폭 정보
스크롤 최신글 이동폭관련링크
본문
스크롤 최신글을 사용중입니다.
(링크 여시면 왼쪽 로긴박스 아래)
그런데 스크롤 되는 이동 거리가 1픽셀 정도 더 커서
한참 띄워놓고 있으면 두개의 게시물이 일부씩 보이게 됩니다.
무엇을 조정해야 이동폭을 높이에 딱맞출 수 있을까요.
<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0">
<tr height="1">
<td bgcolor="#d8d8d8" colspan="3"></td>
</tr>
<tr>
<td width="1" bgcolor="#d8d8d8"></td>
<td>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="10"></td>
<td>
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr height="5"><td colspan="2"></td></tr>
<tr height="21">
<td>
<a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><font color="#555555" ><b><?=$board[bo_subject]?></b></font></a>
</td>
<td align="right"><img src='<?=$latest_skin_path?>/img/icon.gif'><span style="font-size: 11px; color: #646464; font-family:dotum; letter-spacing:-1;"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'>더보기</a></span></td>
</tr>
<tr height="1"><td colspan="2" background="<?=$latest_skin_path?>/img/line_dot.gif" border="0"></td></tr>
<tr height="7"><td colspan="2"></td></tr>
</table>
</td>
<td width="10"></td>
</tr>
</table>
<? if($i>0) { ?>
<?
// marquee 태그를 사용하지 않고 자바스크립트로 이미지가 여러개씩 롤링되도록 함
// 출력되는 테이블의 높이
$marquee[height] = 53;
// include 될때 마다 다른 아이디를 부여 (여러곳에서 이 페이지를 include 할 경우를 대비함)
$uni = uniqid("");
?>
<script language="javascript">
var roll_height_<?=$uni?> = <?=$marquee[height]?>;
var total_area_<?=$uni?> = 0;
var wait_flag_<?=$uni?> = true;
var bMouseOver_<?=$uni?> = 1;
var roll_speed_<?=$uni?> = 1;
var waitingtime_<?=$uni?> = 3000;
var s_tmp_<?=$uni?> = 0;
var s_amount_<?=$uni?> = <?=$marquee[height]?>;
var roll_text_<?=$uni?> = new Array();
var startPanel_<?=$uni?> = 0;
var n_panel_<?=$uni?> = 0;
var i_<?=$uni?> = 0;
function start_roll_<?=$uni?>()
{
i_<?=$uni?> = 0;
for (i_<?=$uni?> in roll_text_<?=$uni?>)
n_panel_<?=$uni?>++;
n_panel_<?=$uni?> = n_panel_<?=$uni?>-1;
startPanel_<?=$uni?> = Math.round(Math.random()*n_panel_<?=$uni?>);
if(startPanel_<?=$uni?> == 0)
{
i_<?=$uni?> = 0;
for (i_<?=$uni?> in roll_text_<?=$uni?>)
insert_area_<?=$uni?>(total_area_<?=$uni?>, total_area_<?=$uni?>++); // area 삽입
}
else if(startPanel_<?=$uni?> == n_panel_<?=$uni?>)
{
insert_area_<?=$uni?>(startPanel_<?=$uni?>, total_area_<?=$uni?>);
total_area_<?=$uni?>++;
for (i_<?=$uni?>=0; i_<?=$uni?><startPanel_<?=$uni?>; i_<?=$uni?>++)
{
insert_area_<?=$uni?>(i_<?=$uni?>, total_area_<?=$uni?>); // area 삽입
total_area_<?=$uni?>++;
}
}
else if((startPanel_<?=$uni?> > 0) || (startPanel_<?=$uni?> < n_panel_<?=$uni?>))
{
insert_area_<?=$uni?>(startPanel_<?=$uni?>, total_area_<?=$uni?>);
total_area_<?=$uni?>++;
for (i_<?=$uni?>=startPanel_<?=$uni?>+1; i_<?=$uni?><=n_panel_<?=$uni?>; i_<?=$uni?>++)
{
insert_area_<?=$uni?>(i_<?=$uni?>, total_area_<?=$uni?>); // area 삽입
total_area_<?=$uni?>++;
}
for (i_<?=$uni?>=0; i_<?=$uni?><startPanel_<?=$uni?>; i_<?=$uni?>++)
{
insert_area_<?=$uni?>(i_<?=$uni?>, total_area_<?=$uni?>); // area 삽입
total_area_<?=$uni?>++;
}
}
if ( navigator.appName == "Microsoft Internet Explorer" )
{
if ( navigator.appVersion.indexOf ( "MSIE 4" ) > -1 )
return ;
}
window.setTimeout("rolling_<?=$uni?>()",waitingtime_<?=$uni?>);
}
function rolling_<?=$uni?>()
{
if (bMouseOver_<?=$uni?> && wait_flag_<?=$uni?>)
{
for (i_<?=$uni?>=0;i_<?=$uni?><total_area_<?=$uni?>;i_<?=$uni?>++){
tmp_<?=$uni?> = document.getElementById('scroll_area_<?=$uni?>'+i_<?=$uni?>).style;
tmp_<?=$uni?>.top = parseInt(tmp_<?=$uni?>.top)-roll_speed_<?=$uni?>;
if (parseInt(tmp_<?=$uni?>.top) <= -roll_height_<?=$uni?>){
tmp_<?=$uni?>.top = roll_height_<?=$uni?>*(total_area_<?=$uni?>-1);
}
if (s_tmp_<?=$uni?>++ > (s_amount_<?=$uni?>-1)*roll_text_<?=$uni?>.length){
wait_flag_<?=$uni?>=false;
window.setTimeout("wait_flag_<?=$uni?>=true;s_tmp_<?=$uni?>=0;",waitingtime_<?=$uni?>);
}
}
}
window.setTimeout("rolling_<?=$uni?>()", 1);
}
function insert_area_<?=$uni?>(idx_<?=$uni?>, n_<?=$uni?>)
{
document.write('<div style="left: 0px; width: 100%; position: absolute; top: '+(roll_height_<?=$uni?>*n_<?=$uni?>)+'px" id="scroll_area_<?=$uni?>'+n_<?=$uni?>+'">\n'+roll_text_<?=$uni?>[idx_<?=$uni?>]+'\n</div>\n');
}
<?
$list_mod = 1; //한번에 롤링되는 게시물 수
///$list_rows = $rows/$list_mod;
$list_rows = $rows/$list_mod;
for ($i=0; $i<=$list_rows; $i++)
{
$roll_text[$i] = "";
$roll_text[$i] .= "<table width='100%' height='65' cellpadding=1 cellspacing=0 border=0>";
$k = 0;
$n = 0;
if($i > 0) $n = $m;
while($n <= count($list)) {
if ($n >= count($list)) break;
$file_url = '../'.$list[$n][file][0][path] .'/'. $list[$n][file][0][file];
$file_url = urlencode($file_url);
// 아래 변수값중 h=120은 썸네일 이미지 height값, w는 width. w값을 수정하였을 경우 11라인의 스타일중 width값을 w값 + 10정도로 해주세요
if($list[$n][file][0][file])
$thumfile = "<img src='{$g4[path]}/phpthumb/phpThumb.php?src=$file_url&h=50&w=70' border='0'>";
else
$thumfile = "<img src='{$latest_skin_path}/img/noimage.gif' width=70 height=50 border='0'>";
$roll_text[$i] .= "<tr>";
$roll_text[$i] .= "<td width='$width%' valign=top>";
$roll_text[$i] .= "<table width='100%' cellpadding=1 cellspacing=0 border=0>";
$roll_text[$i] .= "<tr><td align=left width=70 style='padding-left:5px;'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table'><!--a href='{$list[$n]['href']}'-->$thumfile</a></td>";
$roll_text[$i] .= "<td valign=top align=left><a href='$g4[bbs_path]/board.php?bo_table=$bo_table'><!--a href='{$list[$n]['href']}'-->".addslashes($list[$n]['subject'])."</a></td></tr>";
$roll_text[$i] .= "</table>";
$roll_text[$i] .= "</td>";
$roll_text[$i] .= "</tr>";
$k++;
$n++;
if ($k==$list_mod) break;
}
$m = $n;
// $m = $n + 1;
$roll_text[$i] .= "</table>";
if ($k > 0)
echo "roll_text_{$uni}[$i] = \"{$roll_text[$i]}\";\n";
if ($n >= count($list)) break;
}
?>
</script>
<div style="left: 0px; width: 100%; position: relative; top: 0px; height: <?=$marquee[height]?>px; overflow:hidden;" onMouseover="bMouseOver_<?=$uni?>=0" onMouseout="bMouseOver_<?=$uni?>=1" id="scroll_image_<?=$uni?>">
<script>
var no_script_flag_<?=$uni?> = false ;
if ( navigator.appName == "Microsoft Internet Explorer" )
{
if ( navigator.appVersion.indexOf ( "MSIE 4" ) > -1 )
{
document.write ( roll_text_<?=$uni?>[0] ) ;
no_script_flag_<?=$uni?> = true ;
}
}
if ( no_script_flag_<?=$uni?> == false )
start_roll_<?=$uni?>();
</script>
</div>
<? } ?>
</td>
<td width="1" bgcolor="#d8d8d8"></td>
</tr>
<tr height="6">
<td width="1" bgcolor="#d8d8d8"></td>
<td></td>
<td width="1" bgcolor="#d8d8d8"></td>
</tr>
<tr height="1">
<td bgcolor="#d8d8d8" colspan="3"></td>
</tr>
</table>
댓글 전체

if (s_tmp_<?=$uni?>++ > (s_amount_<?=$uni?>-1)*roll_text_<?=$uni?>.length){
-1을 -2로 바꿔 보세요 스크롤 높이를 지정하는 항목입니다.