웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
한줄씩 올라가는 뉴스티거용 인데요....제로보드하구는 어케...쩝
2003.07.08 11:27
제로보드 뉴스게시판 하구 연동을 할려 했더니 무지 어렵네요...
방법아시거나 다른 좋은 소스 있으신면..같이좀..ㅎㅎ
아래 소스는 해당 뉴스가 한줄씩 위로 올라가서 잠시 멈추고 더시 위로 올라갑니다.
"var pause = 1300;" 이값(1.3초)에 따라 올라가서 멈추는 시간을 설정 할 수 있구요,,
<HTML>
<HEAD>
</HEAD>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<center>
<table border=0 valign=bottom>
<tr>
<td><IMG SRC="blank.gif"
NAME="holdspace" ID="holdspace"
WIDTH="400" HEIGHT="20"
STYLE="visibility:hidden; position:relative;">
</td>
</tr>
</table>
<Script Language="Javascript">
<!--
// bannerconfig.js
var NS4 = (document.layers) ? true : false;
var IE4 = (document.all) ? true : false;
var interval = 20;
var increment = 1;
var pause = 1300;
var bannerColor = "ffffff";
var leftPadding = 2;
var topPadding = 1;
var bannerLeft = (NS4) ? document.images.holdspace.x :
holdspace.offsetLeft;
var bannerTop = (NS4) ? document.images.holdspace.y :
holdspace.offsetTop;
var bannerWidth = (NS4) ? document.images.holdspace.width :
holdspace.width;
var bannerHeight = (NS4) ? document.images.holdspace.height :
holdspace.height;
var ar = new Array(
'<center><tt><font color="#23238e" size=2><b>2001년6월21일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14579" target="_new"><font color="#23238e" size=2>돋보기로 이미지 확대해서 보기</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월21일</b> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14580" target="_new"><font color="#23238e" size=2>예쁜 손목 시계</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월21일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14581" target="_new"><font color="#23238e" size=2>바탕 화면에 눈 내리는 효과 스크립트</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월20일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14503" target="_new"><font color="#23238e" size=2>마우스를 따라 다니는 텍스트 문자열</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월20일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14502" target="_new"><font color="#23238e" size=2>배경 이미지 고정시키는 스크립트</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월20일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14501" target="_new"><font color="#23238e" size=2>한글이 들어간 문자열 길이 구하기</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월19일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14482" target="_new"><font color="#23238e" size=2>슬라이딩 효과를 가미한 메뉴</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월18일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14428" target="_new"><font color="#23238e" size=2>배경색에 페이딩 효과를 주는 스크립트</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월14일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14354" target="_new"><font color="#23238e" size=2>간단한 DHTML 뉴스 틱커</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월14일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14353" target="_new"><font color="#23238e" size=2>CSS 효과를 직접 테스트 하기</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월22일</B> : </font><a href="http://korea.internet.com/channel/list.asp?cid=189&zid=12" target="_new"><font color="#23238e" size=2>자바스크립트 소스/예제 보기</center>'
);
// banner.js
onload = startBanner;
function showMessage(n, show) {
var whichEl = (NS4) ? eval("message" + n) :
eval("message" + n + ".style");
whichEl.visibility = (show) ? ((NS4) ? "show" : "visible") :
((NS4) ? "hide" : "hidden");
}
function nextMessage() {
var fromInd = current;
current = (fromInd == ar.length - 1) ? 0 : fromInd + 1;
scrollBanner(fromInd, current);
}
function moveUp() {
if (NS4) {
fromEl.top -= increment;
if (toEl.top - increment <= toElTarget) {
toEl.top = toElTarget;
clearInterval(intervalID);
fromEl.visibility = "hide";
timeoutID = setTimeout("nextMessage()", pause);
} else {
toEl.top -= increment;
}
} else {
fromEl.pixelTop -= increment;
if (toEl.pixelTop - increment <= toElTarget) {
toEl.pixelTop = toElTarget;
clearInterval(intervalID);
fromEl.visibility = "hidden";
timeoutID = setTimeout("nextMessage()", pause);
} else {
toEl.pixelTop -= increment;
}
}
}
function scrollBanner(from, to) {
if (NS4) {
fromEl = eval("message" + from);
toEl = eval("message" + to);
toEl.top = fromEl.top + bannerHeight;
toElTarget = fromEl.top;
} else {
fromEl = eval("message" + from + ".style");
toEl = eval("message" + to + ".style");
toEl.pixelTop = fromEl.pixelTop + bannerHeight;
toElTarget = fromEl.pixelTop;
}
showMessage(to, true); // show the upcoming message
intervalID = setInterval("moveUp()", interval);
}
function makeIE() {
// assign the necessary code to a variable
var text = '<DIV ID="banner" STYLE="position:absolute">';
for (var i = ar.length - 1; i >= 0; i--) {
text += '<DIV ID="message' + i +
'" STYLE="position:absolute"></DIV>';
}
text += '</DIV>';
// insert the code before the end of the document
document.body.insertAdjacentHTML("BeforeEnd", text);
// define the main element's properties
with (banner.style) {
width = bannerWidth;
height = bannerHeight;
clip = "rect(0 " + bannerWidth + " " + bannerHeight + " 0)";
backgroundColor = bannerColor;
pixelLeft = bannerLeft;
pixelTop = bannerTop;
}
// define the child elements' properties
for (i = 0; i < ar.length; i++) {
with (eval("message" + i + ".style")) {
visibility = "hidden";
pixelLeft = leftPadding;
pixelTop = topPadding;
width = bannerWidth - leftPadding;
backgroundColor = bannerColor;
}
}
}
function makeNS() {
// create the main element
banner = new Layer(bannerWidth);
// define the main element's properties
with (banner) {
clip.right = bannerWidth;
clip.bottom = bannerHeight;
document.bgColor = bannerColor;
left = bannerLeft;
top = bannerTop;
visibility = "show";
}
// define the child elements' properties
for (var i = 0; i < ar.length; i++) {
// create a child element
eval("message" + i + " = " +
"new Layer(bannerWidth - leftPadding, banner)");
with(eval("message" + i)) {
visibility = "hide";
left = leftPadding;
top = topPadding;
document.bgColor = bannerColor;
}
}
}
function fillBanner() {
var whichEl;
if (NS4) {
for (var i = 0; i < ar.length; i++) {
whichEl = eval("message" + i);
whichEl.document.write(ar[i]);
whichEl.document.close();
}
} else {
for (var i = 0; i < ar.length; i++) {
whichEl = eval("message" + i);
whichEl.innerHTML = ar[i];
}
}
}
function startBanner() {
if (NS4)
makeNS()
else
makeIE();
fillBanner();
showMessage(0, true);
current = 0;
timeoutID = setTimeout("nextMessage()", pause);
}
// done hiding -->
</Script>
</body>
</html>
방법아시거나 다른 좋은 소스 있으신면..같이좀..ㅎㅎ
아래 소스는 해당 뉴스가 한줄씩 위로 올라가서 잠시 멈추고 더시 위로 올라갑니다.
"var pause = 1300;" 이값(1.3초)에 따라 올라가서 멈추는 시간을 설정 할 수 있구요,,
<HTML>
<HEAD>
</HEAD>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<center>
<table border=0 valign=bottom>
<tr>
<td><IMG SRC="blank.gif"
NAME="holdspace" ID="holdspace"
WIDTH="400" HEIGHT="20"
STYLE="visibility:hidden; position:relative;">
</td>
</tr>
</table>
<Script Language="Javascript">
<!--
// bannerconfig.js
var NS4 = (document.layers) ? true : false;
var IE4 = (document.all) ? true : false;
var interval = 20;
var increment = 1;
var pause = 1300;
var bannerColor = "ffffff";
var leftPadding = 2;
var topPadding = 1;
var bannerLeft = (NS4) ? document.images.holdspace.x :
holdspace.offsetLeft;
var bannerTop = (NS4) ? document.images.holdspace.y :
holdspace.offsetTop;
var bannerWidth = (NS4) ? document.images.holdspace.width :
holdspace.width;
var bannerHeight = (NS4) ? document.images.holdspace.height :
holdspace.height;
var ar = new Array(
'<center><tt><font color="#23238e" size=2><b>2001년6월21일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14579" target="_new"><font color="#23238e" size=2>돋보기로 이미지 확대해서 보기</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월21일</b> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14580" target="_new"><font color="#23238e" size=2>예쁜 손목 시계</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월21일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14581" target="_new"><font color="#23238e" size=2>바탕 화면에 눈 내리는 효과 스크립트</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월20일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14503" target="_new"><font color="#23238e" size=2>마우스를 따라 다니는 텍스트 문자열</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월20일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14502" target="_new"><font color="#23238e" size=2>배경 이미지 고정시키는 스크립트</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월20일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14501" target="_new"><font color="#23238e" size=2>한글이 들어간 문자열 길이 구하기</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월19일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14482" target="_new"><font color="#23238e" size=2>슬라이딩 효과를 가미한 메뉴</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월18일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14428" target="_new"><font color="#23238e" size=2>배경색에 페이딩 효과를 주는 스크립트</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월14일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14354" target="_new"><font color="#23238e" size=2>간단한 DHTML 뉴스 틱커</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월14일</B> : </font><a href="http://korea.internet.com/channel/content.asp?kid=13&nid=14353" target="_new"><font color="#23238e" size=2>CSS 효과를 직접 테스트 하기</center>',
'<center><tt><font color="#23238e" size=2><b>2001년6월22일</B> : </font><a href="http://korea.internet.com/channel/list.asp?cid=189&zid=12" target="_new"><font color="#23238e" size=2>자바스크립트 소스/예제 보기</center>'
);
// banner.js
onload = startBanner;
function showMessage(n, show) {
var whichEl = (NS4) ? eval("message" + n) :
eval("message" + n + ".style");
whichEl.visibility = (show) ? ((NS4) ? "show" : "visible") :
((NS4) ? "hide" : "hidden");
}
function nextMessage() {
var fromInd = current;
current = (fromInd == ar.length - 1) ? 0 : fromInd + 1;
scrollBanner(fromInd, current);
}
function moveUp() {
if (NS4) {
fromEl.top -= increment;
if (toEl.top - increment <= toElTarget) {
toEl.top = toElTarget;
clearInterval(intervalID);
fromEl.visibility = "hide";
timeoutID = setTimeout("nextMessage()", pause);
} else {
toEl.top -= increment;
}
} else {
fromEl.pixelTop -= increment;
if (toEl.pixelTop - increment <= toElTarget) {
toEl.pixelTop = toElTarget;
clearInterval(intervalID);
fromEl.visibility = "hidden";
timeoutID = setTimeout("nextMessage()", pause);
} else {
toEl.pixelTop -= increment;
}
}
}
function scrollBanner(from, to) {
if (NS4) {
fromEl = eval("message" + from);
toEl = eval("message" + to);
toEl.top = fromEl.top + bannerHeight;
toElTarget = fromEl.top;
} else {
fromEl = eval("message" + from + ".style");
toEl = eval("message" + to + ".style");
toEl.pixelTop = fromEl.pixelTop + bannerHeight;
toElTarget = fromEl.pixelTop;
}
showMessage(to, true); // show the upcoming message
intervalID = setInterval("moveUp()", interval);
}
function makeIE() {
// assign the necessary code to a variable
var text = '<DIV ID="banner" STYLE="position:absolute">';
for (var i = ar.length - 1; i >= 0; i--) {
text += '<DIV ID="message' + i +
'" STYLE="position:absolute"></DIV>';
}
text += '</DIV>';
// insert the code before the end of the document
document.body.insertAdjacentHTML("BeforeEnd", text);
// define the main element's properties
with (banner.style) {
width = bannerWidth;
height = bannerHeight;
clip = "rect(0 " + bannerWidth + " " + bannerHeight + " 0)";
backgroundColor = bannerColor;
pixelLeft = bannerLeft;
pixelTop = bannerTop;
}
// define the child elements' properties
for (i = 0; i < ar.length; i++) {
with (eval("message" + i + ".style")) {
visibility = "hidden";
pixelLeft = leftPadding;
pixelTop = topPadding;
width = bannerWidth - leftPadding;
backgroundColor = bannerColor;
}
}
}
function makeNS() {
// create the main element
banner = new Layer(bannerWidth);
// define the main element's properties
with (banner) {
clip.right = bannerWidth;
clip.bottom = bannerHeight;
document.bgColor = bannerColor;
left = bannerLeft;
top = bannerTop;
visibility = "show";
}
// define the child elements' properties
for (var i = 0; i < ar.length; i++) {
// create a child element
eval("message" + i + " = " +
"new Layer(bannerWidth - leftPadding, banner)");
with(eval("message" + i)) {
visibility = "hide";
left = leftPadding;
top = topPadding;
document.bgColor = bannerColor;
}
}
}
function fillBanner() {
var whichEl;
if (NS4) {
for (var i = 0; i < ar.length; i++) {
whichEl = eval("message" + i);
whichEl.document.write(ar[i]);
whichEl.document.close();
}
} else {
for (var i = 0; i < ar.length; i++) {
whichEl = eval("message" + i);
whichEl.innerHTML = ar[i];
}
}
}
function startBanner() {
if (NS4)
makeNS()
else
makeIE();
fillBanner();
showMessage(0, true);
current = 0;
timeoutID = setTimeout("nextMessage()", pause);
}
// done hiding -->
</Script>
</body>
</html>
댓글 12
-
마녀의조건
2003.07.08 12:42
오호 +.+ 괜찮내요 찾고있던건대... 제로보드랑 연동된다믄 ㅠ.ㅠ -
세죠위그이
2003.07.08 12:43
"신이내린 스크립트". ^^ -
하나비
2003.07.08 14:01
요거요거 어떻게 게시판 글목록이 흐르게 만들수 있는지 아시는분 ..손!!
vb 스크립트루 만들어야 하나,,쩝!! -
[포터]아렌티
2003.07.08 17:16
최근게시물을 이용해서 가능할꺼 같네요..
자바 충돌만 안일어 난다면.. 말이죠..;; -
하나비
2003.07.08 18:12
아렌티//저두 생각은 해봤는디..당췌 머리가 돌아가야 말이죵....^^
함해봐주시죠...ㅎㅎ -
특급잠수부
2003.07.15 11:49
var ar = new Array();
var list_str;
<?
$query = "select * from TBL order by no desc limit 5";
$select = mysql_query($query,$conn) or die (mysql_error());
while ($sr = mysql_fetch_assoc($select))
{
?>
list_str = "";
list_str += "<center><tt><font color="#23238e" size=2><b><?=$date?></b> : ";
list_str += "<a href="/bbs/view.php?id=<?=$board_id?>&no=<?=$sr[no]?>"><font color="#23238e" size=2><?=$subject?></center>";
ar[] = list_str;
<?
}
?> -
특급잠수부
2003.07.15 11:50
배열 추가부분에서 끝나지 않은 문자열이란 오류가 뜰수도 있음
아 그리고 당연히 $date는 날짜값 string $subject는 제목입니다.
while {} 에 추가하시면 되겠죠.. -
하나비
2003.07.19 22:39
특급잠수부님//
최근게시물 소스에 적용하려고 하는데요...위소스적용을 어떻게 해야 하는지...제가 허접하다보니... -
에지
2003.08.17 13:37
어-_-; 저 신이내린 스크립트 제로보드랑 연동해서 쓰는데-0-;;; -
진짜루초보
2003.10.14 22:00
이 신이 내린 스크립트 제로랑 연동하는것좀 갈켜 주세요.. 최근게기물하고요..ㅡㅡ;;
이왕이면 만들어진 게시판 몽땅이면 좋을거 같은데...ㅡㅡ;; 당췌 지도 머리가 안돌아 가서리. -
정지웅
2003.12.07 03:06
왜 한줄씩만 올라가죠..... ㅡㅡ; 다음에 뉴스처럼 여러줄로 조정은 어떻게 해야하나요... 사이즈를 100로 하니깐 공간만 길어지고 한줄씩올라가는데... -
유난영
2007.02.21 14:46
저는 한줄말고 3줄 정도 하고 싶은데.. 여기저기 쏘스 찾아봐도 그건 없네용~~ 아시는분 리플 부탁해요
제목 | 글쓴이 | 날짜 |
---|---|---|
제로보드 XE가 갑자기 느려져서 확인해봤더니 [1] | jy1664 | 2009.10.27 |
제로보드4->XE 데이터 이전 시 회원 정보 오류 / 포인트 문제 [10] | 개돌 | 2009.10.08 |
제로보드 매뉴얼 version 0.63 입니다. [16] | 윈매니아 | 2009.07.03 |
지오피아 게임 제로보드 XE 연동 [5] | 다른사람 | 2009.06.30 |
제로보드4, xe 버전 바이러스에 대한 질문 [1] | 투자혁명 | 2009.04.15 |
제로보드 권한 설정 문제요~~ [1] | 매너굿남 | 2009.03.27 |
제로보드의 아이콘을 내 맘대로 변경하기...(2) [2] | winter548 | 2009.03.23 |
제로보드의 아이콘을 내 맘대로 변경하기...(1) [3] | winter548 | 2009.03.23 |
제로보드 XE나 개인 블로그에 GPS 로그(궤적)를 나타낸 구글맵 삽입하기 | 상오기 | 2009.03.21 |
제로보드에서 아이프레임(iframe) 높이 자동조절(파폭,IE, 모두 작동) [10] | HaruKaze | 2009.03.17 |
드림위버에서 제로보드 XE 레이아웃 편집하기 [4] | 샤릉해 | 2009.02.10 |
제로보드XE 외부출석부 [1] | noirzo | 2009.01.18 |
제로보드 DTREE 메뉴 적용하기 ( 카테고리 선택기 흉내 냈습니다.) [5] | 조성우371 | 2009.01.17 |
(재 수정) 제로보드 XE 신버젼에 Lavalic 2 설치하기 [4] | 조성우371 | 2009.01.16 |
제로보드XE 쉽게 업데이트 하는 방법.. [13] | 청개구리00 | 2009.01.12 |
IIS7, PHP 5, MySQL 5, 제로보드 설치기 [1] | 54장 | 2008.12.26 |
제로보드XE XML파일 표준화 [2] | BlueGATE | 2008.11.13 |
제로보드XE 가로 스크롤 문제 해결 방법 [7] | digitalist | 2008.11.12 |
플래시 BGM 음악 제로보드에 넣는 방법 | 푸른커튼 | 2008.10.29 |
카페24 계정 사용 중에 제로보드XE 로그인 오류가 날 때 [1] | vltm | 2008.10.24 |