위로스크롤되는 최근게시물 두개이상 설치하기 정보
위로스크롤되는 최근게시물 두개이상 설치하기본문
사용하는 스킨은
시그너스님의 한줄 이미지 스크롤 최신글입니다.
메인화면에서 이 스킨을 이용하여 사진이 한장씩 위로 스크롤 되는데요
한군데서만 하면 적용이 되는데
이것을 메인페이지의 두곳에서 사용할 경우 처음것만 작동이 되네요
그림처럼 세곳에 이 스킨을 적용하고 싶은데..
같은 스크립트가 중첩되서 한곳에만 적용이 되는것 같은데
세곳 모두 사용할 수 있는 방법 좀 알려주세요
적용은
<? echo latest_group("photo_scroll", "product", 3, 5); ?>
<? echo latest_group("photo_scroll", "ga03", 3, 5); ?>
<? echo latest_group("photo_scroll", "ga02", 3, 5); ?>
이 상태로 세가지의 그룹 최신글 불러오기응 사용했습니다.
한페이지에서 여러군데 사용할 수 있는 방법을 알려주세요
단 위 세가지 그룹의 최신 사진을 해당 칸별로 불러와야 하며
위로 스크롤이 되어야 한다는 점입니다.
같은 스크롤을 세군데서 동시에 작동이 되야 합니다.
고수님들 부탁드립니다. (__)
댓글 전체
중첩되는 스크립트부분의 변수명을 중첩되지않도록 바꿔주세요...^^
변수1 . 변수2 이런 방식으로해도 됩니다...^^
변수1 . 변수2 이런 방식으로해도 됩니다...^^
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//이미지 한줄스크롤되는 최신글
?>
<script>
function scroll() {
this.name = "scroll";
this.item = new Array();
this.itemcount = 0;
this.currentspeed = 0;
this.scrollspeed = 50;
this.pausedelay = 1000;
this.pausemouseover = false;
this.stop = false;
this.type = 1;
this.height = 125;
this.width = 180;
this.stopHeight=2;
this.add =function () {
var text = arguments[0];
this.item[this.itemcount] = text;
this.itemcount = this.itemcount + 1;
};
this.start = function () {
this.display();
this.currentspeed = this.scrollspeed;
setTimeout(this.name+'.scroll()',this.currentspeed);
};
this.display =function () {
document.write('<div id="'+this.name+'" style="height:'+this.height+';width:'+this.width+';position:relative;overflow:hidden;" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">');
for(var i = 0; i < this.itemcount; i++) {if ( this.type == 1) {
document.write('<div id="'+this.name+'item'+i+'"style="left:0px;width:'+this.width+';position:absolute;top:'+(this.height*i+1)+'px;">');
document.write(this.item[i]);
document.write('</div>');
}
else if ( this.type == 2 ) {
document.write('<div id="'+this.name+'item'+i+'"style="left:'+(this.width*i+1)+'px;width:'+this.width+';position:absolute;top:0px;">');
document.write(this.item[i]);
document.write('</div>');
}
}
document.write('</div>');
};
this.scroll = function () {
this.currentspeed = this.scrollspeed;if ( !this.stop ) {
for (i = 0; i < this.itemcount; i++) {
obj = document.getElementById(this.name+'item'+i).style;if ( this.type == 1 ) {
obj.top = parseInt(obj.top) - 1;
if ( parseInt(obj.top) <= this.height*(-1) ) obj.top = this.height * (this.itemcount-1);
if ( parseInt(obj.top) == 0 || ( this.stopHeight > 0 && this.stopHeight - parseInt(obj.top) == 0 ) ) this.currentspeed = this.pausedelay;
}
else if ( this.type == 2 ) {
obj.left = parseInt(obj.left) - 1;
if ( parseInt(obj.left) <= this.left*(-1) ) obj.left = this.left* (this.itemcount-1);
if ( parseInt(obj.left) == 0 ) this.currentspeed = this.pausedelay;
}
}
}
window.setTimeout(this.name+".scroll()",this.currentspeed);
};
this.onmouseover = function () {
if ( this.pausemouseover ) {
this.stop = true;}
};
this.onmouseout = function () {
if ( this.pausemouseover ) {
this.stop = false;
}
};
}
</script>
<table border="0" cellpadding="3" cellspacing="0" bgcolor='#FFFFFF'>
<tr>
<td align='center'>
<script>
cont = new scroll();
cont.name = "cont";
cont.height = 125;
cont.width = 180;
cont.scrollspeed = 20;
cont.pausedelay = 3000;
cont.pausemouseover = true;
<? for ($k=0; $k<count($list); $k++) { ?>
<?
$image = urlencode($list[$k][file][0][file]); // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image))
$data_path = $g4[path]."/data/file/$bo_table";
$thum_path = $data_path.'/thumb'; //썸네일경로
$thumb = $thum_path.'/'.$list[$k][wr_id];
if ( file_exists($thumb) )
{ // 썸네일
$img = "<img src='$thumb' height='115' border='1'>";
}
else {
$img = "<img src='$g4[path]/data/file/{$list[$k][bo_table]}/$image' height='115' border='1'>";
}
?>
cont.add("<a href='<?=$list[$k][href]?>'><?=$img?></a>");
<?}?>
cont.start(); </script></td>
</tr>
</table>
=========================================
photo_scroll의 latest.skin.php 파일 소스입니다.
저 소스를 세군데 사용할려고 하는데 어떤 부분을 다르게 수정해야 하는지요..
부탁드립니다.
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//이미지 한줄스크롤되는 최신글
?>
<script>
function scroll() {
this.name = "scroll";
this.item = new Array();
this.itemcount = 0;
this.currentspeed = 0;
this.scrollspeed = 50;
this.pausedelay = 1000;
this.pausemouseover = false;
this.stop = false;
this.type = 1;
this.height = 125;
this.width = 180;
this.stopHeight=2;
this.add =function () {
var text = arguments[0];
this.item[this.itemcount] = text;
this.itemcount = this.itemcount + 1;
};
this.start = function () {
this.display();
this.currentspeed = this.scrollspeed;
setTimeout(this.name+'.scroll()',this.currentspeed);
};
this.display =function () {
document.write('<div id="'+this.name+'" style="height:'+this.height+';width:'+this.width+';position:relative;overflow:hidden;" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">');
for(var i = 0; i < this.itemcount; i++) {if ( this.type == 1) {
document.write('<div id="'+this.name+'item'+i+'"style="left:0px;width:'+this.width+';position:absolute;top:'+(this.height*i+1)+'px;">');
document.write(this.item[i]);
document.write('</div>');
}
else if ( this.type == 2 ) {
document.write('<div id="'+this.name+'item'+i+'"style="left:'+(this.width*i+1)+'px;width:'+this.width+';position:absolute;top:0px;">');
document.write(this.item[i]);
document.write('</div>');
}
}
document.write('</div>');
};
this.scroll = function () {
this.currentspeed = this.scrollspeed;if ( !this.stop ) {
for (i = 0; i < this.itemcount; i++) {
obj = document.getElementById(this.name+'item'+i).style;if ( this.type == 1 ) {
obj.top = parseInt(obj.top) - 1;
if ( parseInt(obj.top) <= this.height*(-1) ) obj.top = this.height * (this.itemcount-1);
if ( parseInt(obj.top) == 0 || ( this.stopHeight > 0 && this.stopHeight - parseInt(obj.top) == 0 ) ) this.currentspeed = this.pausedelay;
}
else if ( this.type == 2 ) {
obj.left = parseInt(obj.left) - 1;
if ( parseInt(obj.left) <= this.left*(-1) ) obj.left = this.left* (this.itemcount-1);
if ( parseInt(obj.left) == 0 ) this.currentspeed = this.pausedelay;
}
}
}
window.setTimeout(this.name+".scroll()",this.currentspeed);
};
this.onmouseover = function () {
if ( this.pausemouseover ) {
this.stop = true;}
};
this.onmouseout = function () {
if ( this.pausemouseover ) {
this.stop = false;
}
};
}
</script>
<table border="0" cellpadding="3" cellspacing="0" bgcolor='#FFFFFF'>
<tr>
<td align='center'>
<script>
cont = new scroll();
cont.name = "cont";
cont.height = 125;
cont.width = 180;
cont.scrollspeed = 20;
cont.pausedelay = 3000;
cont.pausemouseover = true;
<? for ($k=0; $k<count($list); $k++) { ?>
<?
$image = urlencode($list[$k][file][0][file]); // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image))
$data_path = $g4[path]."/data/file/$bo_table";
$thum_path = $data_path.'/thumb'; //썸네일경로
$thumb = $thum_path.'/'.$list[$k][wr_id];
if ( file_exists($thumb) )
{ // 썸네일
$img = "<img src='$thumb' height='115' border='1'>";
}
else {
$img = "<img src='$g4[path]/data/file/{$list[$k][bo_table]}/$image' height='115' border='1'>";
}
?>
cont.add("<a href='<?=$list[$k][href]?>'><?=$img?></a>");
<?}?>
cont.start(); </script></td>
</tr>
</table>
=========================================
photo_scroll의 latest.skin.php 파일 소스입니다.
저 소스를 세군데 사용할려고 하는데 어떤 부분을 다르게 수정해야 하는지요..
부탁드립니다.