최신 이미지 스크롤소스에서 아래에서 위로가 아닌 우측에서 좌측으로 정보
최신 이미지 스크롤소스에서 아래에서 위로가 아닌 우측에서 좌측으로본문
최신글 이미지 스크롤 소스입니다.
아래 소스중 우측에서 좌측으로 쉬지않고 스크롤 되며 마우스 오버시 잠깐 멈추게 하려면
어떤 부분을 고쳐야 할까요
<script language="javascript">
var roll_height_s = 150;
var total_area_s = 0;
var wait_flag_s = true;
var bMouseOver_s = 1;
var roll_speed_s = 1;
var waitingtime_s = 3000; //스피드
var s_tmp_s = 0;
var s_amount_s = 120;
var roll_text_s = new Array();
var startPanel_s = 0;
var n_panel_s = 0;
var i_s = 0;
function start_roll_s()
{
i_s = 0;
for (i_s in roll_text_s)
n_panel_s++;
n_panel_s = n_panel_s -1 ;
startPanel_s = Math.round(Math.random()*n_panel_s);
if(startPanel_s == 0)
{
i_s = 0;
for (i_s in roll_text_s)
insert_area_s(total_area_s, total_area_s++); // area 삽입
}
else if(startPanel_s == n_panel_s)
{
insert_area_s(startPanel_s, total_area_s);
total_area_s++;
for (i_s=0; i_s<startPanel_s; i_s++)
{
insert_area_s(i_s, total_area_s); // area 삽입
total_area_s++;
}
}
else if((startPanel_s > 0) || (startPanel_s < n_panel_s))
{
insert_area_s(startPanel_s, total_area_s);
total_area_s++;
for (i_s=startPanel_s+1; i_s<=n_panel_s; i_s++)
{
insert_area_s(i_s, total_area_s); // area 삽입
total_area_s++;
}
for (i_s=0; i_s<startPanel_s; i_s++)
{
insert_area_s(i_s, total_area_s); // area 삽입
total_area_s++;
}
}
if ( navigator.appName == "Microsoft Internet Explorer" )
{
if ( navigator.appVersion.indexOf ( "MSIE 4" ) > -1 )
return ;
}
window.setTimeout("rolling_s()",waitingtime_s);
}
function rolling_s()
{
if (bMouseOver_s && wait_flag_s)
{
for (i_s=0;i_s<total_area_s;i_s++){
tmp_s = document.getElementById('scroll_area_s'+i_s).style;
tmp_s.top = parseInt(tmp_s.top)-roll_speed_s;
if (parseInt(tmp_s.top) <= -roll_height_s){
tmp_s.top = roll_height_s*(total_area_s-1);
}
if (s_tmp_s++ > (s_amount_s-1)*roll_text_s.length){
wait_flag_s=false;
window.setTimeout("wait_flag_s=true;s_tmp_s=0;",waitingtime_s);
}
}
}
window.setTimeout("rolling_s()", 1);
}
function insert_area_s(idx_s, n_s)
{
document.write('<div style="left: 0px; width: 100%; position: absolute; top: '+(roll_height_s*n_s)+'px" id="scroll_area_s'+n_s+'">\n'+roll_text_s[idx_s]+'\n</div>\n');
}
<?
$java_script = "";
for ($i=0; $i<count($list); $i++) {
$ooo='<table width=100% height=120 cellpadding=1 cellspacing=0 border=0><tr><td width=100%><table width=100% height=120 cellpadding=1 cellspacing=0 border=0><tr><td align=center><a href='.$list[$i][href].'><img src=\"'.$list[$i][file_image1].'\" width=\"150\" height=\"120\" border=0></a></td></tr><tr><td align=center height=\"40\"><a href='.$list[$i][href].'><b><font color=\"#005cab\">[ '.$list[$i][subject].' ]</font></b></a></td></tr></table></td></tr></table>';
$java_script .= "roll_text_s[$i]='$ooo'\n";
}
echo $java_script;
?>
</script>
<div style="left: 0px; width: 100%; position: relative; top: 0px; height: 120px; overflow:hidden;" onMouseover="bMouseOver_s=0" onMouseout="bMouseOver_s=1" id="scroll_image_s">
<script>
var no_script_flag_s = false ;
if ( navigator.appName == "Microsoft Internet Explorer" )
{
if ( navigator.appVersion.indexOf ( "MSIE 4" ) > -1 )
{
document.write ( roll_text_s[0] ) ;
no_script_flag_s = true ;
}
}
if ( no_script_flag_s == false )
start_roll_s();
</script>
</div>
아래 소스중 우측에서 좌측으로 쉬지않고 스크롤 되며 마우스 오버시 잠깐 멈추게 하려면
어떤 부분을 고쳐야 할까요
<script language="javascript">
var roll_height_s = 150;
var total_area_s = 0;
var wait_flag_s = true;
var bMouseOver_s = 1;
var roll_speed_s = 1;
var waitingtime_s = 3000; //스피드
var s_tmp_s = 0;
var s_amount_s = 120;
var roll_text_s = new Array();
var startPanel_s = 0;
var n_panel_s = 0;
var i_s = 0;
function start_roll_s()
{
i_s = 0;
for (i_s in roll_text_s)
n_panel_s++;
n_panel_s = n_panel_s -1 ;
startPanel_s = Math.round(Math.random()*n_panel_s);
if(startPanel_s == 0)
{
i_s = 0;
for (i_s in roll_text_s)
insert_area_s(total_area_s, total_area_s++); // area 삽입
}
else if(startPanel_s == n_panel_s)
{
insert_area_s(startPanel_s, total_area_s);
total_area_s++;
for (i_s=0; i_s<startPanel_s; i_s++)
{
insert_area_s(i_s, total_area_s); // area 삽입
total_area_s++;
}
}
else if((startPanel_s > 0) || (startPanel_s < n_panel_s))
{
insert_area_s(startPanel_s, total_area_s);
total_area_s++;
for (i_s=startPanel_s+1; i_s<=n_panel_s; i_s++)
{
insert_area_s(i_s, total_area_s); // area 삽입
total_area_s++;
}
for (i_s=0; i_s<startPanel_s; i_s++)
{
insert_area_s(i_s, total_area_s); // area 삽입
total_area_s++;
}
}
if ( navigator.appName == "Microsoft Internet Explorer" )
{
if ( navigator.appVersion.indexOf ( "MSIE 4" ) > -1 )
return ;
}
window.setTimeout("rolling_s()",waitingtime_s);
}
function rolling_s()
{
if (bMouseOver_s && wait_flag_s)
{
for (i_s=0;i_s<total_area_s;i_s++){
tmp_s = document.getElementById('scroll_area_s'+i_s).style;
tmp_s.top = parseInt(tmp_s.top)-roll_speed_s;
if (parseInt(tmp_s.top) <= -roll_height_s){
tmp_s.top = roll_height_s*(total_area_s-1);
}
if (s_tmp_s++ > (s_amount_s-1)*roll_text_s.length){
wait_flag_s=false;
window.setTimeout("wait_flag_s=true;s_tmp_s=0;",waitingtime_s);
}
}
}
window.setTimeout("rolling_s()", 1);
}
function insert_area_s(idx_s, n_s)
{
document.write('<div style="left: 0px; width: 100%; position: absolute; top: '+(roll_height_s*n_s)+'px" id="scroll_area_s'+n_s+'">\n'+roll_text_s[idx_s]+'\n</div>\n');
}
<?
$java_script = "";
for ($i=0; $i<count($list); $i++) {
$ooo='<table width=100% height=120 cellpadding=1 cellspacing=0 border=0><tr><td width=100%><table width=100% height=120 cellpadding=1 cellspacing=0 border=0><tr><td align=center><a href='.$list[$i][href].'><img src=\"'.$list[$i][file_image1].'\" width=\"150\" height=\"120\" border=0></a></td></tr><tr><td align=center height=\"40\"><a href='.$list[$i][href].'><b><font color=\"#005cab\">[ '.$list[$i][subject].' ]</font></b></a></td></tr></table></td></tr></table>';
$java_script .= "roll_text_s[$i]='$ooo'\n";
}
echo $java_script;
?>
</script>
<div style="left: 0px; width: 100%; position: relative; top: 0px; height: 120px; overflow:hidden;" onMouseover="bMouseOver_s=0" onMouseout="bMouseOver_s=1" id="scroll_image_s">
<script>
var no_script_flag_s = false ;
if ( navigator.appName == "Microsoft Internet Explorer" )
{
if ( navigator.appVersion.indexOf ( "MSIE 4" ) > -1 )
{
document.write ( roll_text_s[0] ) ;
no_script_flag_s = true ;
}
}
if ( no_script_flag_s == false )
start_roll_s();
</script>
</div>
댓글 전체
function rolling_s()에서
tmp_s.top = parseInt(tmp_s.top)-roll_speed_s;
tmp_s.right로 바꿔 보시고
숫자 계산은 또 하셔야 할 듯 합니다.
tmp_s.top = parseInt(tmp_s.top)-roll_speed_s;
tmp_s.right로 바꿔 보시고
숫자 계산은 또 하셔야 할 듯 합니다.