최신글 정렬좀 도와주세요~
본문
최신글 카테고리 탭 최신글 스킨(JQuery 사용)
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=90602 을 사용하는데
그림과 같이 정렬이 안되네요 정렬좀 도와주세요?
latest.skin.php 입니다
-----------------------------------------------------------------------------
<?
$write_table =$g4[write_prefix].$bo_table;
$row = sql_fetch(" SELECT bo_category_list FROM $g4[board_table] WHERE bo_table = '$bo_table' ");
$arr = explode("|", $row[bo_category_list]); // 구분자가 , 로 되어 있음
//echo count($arr);
?>
<style>
.tab1 ul, .tab1 li {list-style:none;}
.tab1 {width:300px;}
.tab1 li {float:left; border:1px solid #dadada; background:#f5f5f5;padding:3px 0px 4px 0px;}
.tab1 li a {padding:0px 10px 0px 10px;letter-spacing:1px;}
.tab1 li.selected { border-bottom:1px solid #fff; background:#fff; z-index:1;}
.tab1 li.selected a { color:#262575; font-weight:bold; letter-spacing:-1px;}
.tab_title {height:18px;}
.tab_item {padding-top:5px;}
.tab_item li {height:20px;}
</style>
<div id="latest_tab">
<!--<div class="tab_title"><strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></div>//-->
<ul class="tab1">
<?
for ($i=0; $i<count($arr); $i++) {
echo "<li class=\"m".sprintf("%02d", ($i+1));
if ($i==0) echo " selected";
echo "\" onMouseOver=\"javascript:view_tab1('latest', 'li', '".$i."');\"><a href=\"".$g4[bbs_path]."/board.php?bo_table=".$bo_table."&sca=".$arr[$i]."\" border=\"0\" title=\"$arr[$i]\">".$arr[$i]."</a></li>\n";
}
?>
</ul>
<?
for ($i=0; $i<count($arr); $i++) {
echo "<div class='tab_item' id='latest_item_{$i}'";
if ($i==0)
echo " style='display:block'>\n";
else
echo " style='display:none'>\n";
$list = "";
$sql = " select count(*) as cnt from $write_table where ca_name='".$arr[$i]."' and wr_is_comment = 0 ";
$row = sql_fetch($sql);
$list_count = $row[cnt];
if ($list_count > 0) {
$sql = " select * from $write_table where ca_name='".$arr[$i]."' and wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
$result = sql_query($sql);
for ($k=0; $row = sql_fetch_array($result); $k++)
$list[$k] = get_list($row, $board, $latest_skin_path, $subject_len);
echo "<ul>\n";
for ($j=0; $j<count($list); $j++) {
echo "<li>";
echo "- <a href='{$list[$j]['href']}'>";
echo "{$list[$j]['subject']}";
echo "</a>";
echo "</li>\n";
}
echo "</ul>\n";
}
echo "</div>\n";
}
?>
</div>
<script language="text/javascript">
<!--
function view_tab1( obj, tag, number ) {
var tab = $("#"+obj+"_tab")[0].getElementsByTagName(tag);
var tab_len = tab.length;
for( i=0; i<tab_len; i++ ) {
if( i == number ) {
$(tab[i]).addClass('selected');
$("#"+obj+"_item_"+i).show();
} else {
$(tab[i]).removeClass('selected');
$("#"+obj+"_item_"+i).hide();
}
}
}
//-->
</script>
답변 1
해당 사항은 전체적인 소스를 봐야 할 사항이지만..
그림만 봐서는 탭에서 float:left 준것이 아래 한줄 더 먹어서 그런겁니다.
.tab_item {padding-top:5px;clear:both;}
로 변경해부세요..