javascript 팁이 있는 곳입니다.
  • 웹미니 한줄 전광판 영역 입니다.
글 수 109
미리보기 :  
플래시에서 가능한 한줄 뉴스티커효과입니다.
[1단계] 아래의 코드를 <head> 와 </head> 사이에 붙여 넣으세요.

<style type="text/css">
/** 뉴스티커가 보여질 창에 대한 설정입니다 **/
#memoryticker{
background-color: lightyellow; /**배경색상**/
width: 450px; /**가로크기**/
font: bold 12px Verdana; /**글꼴**/
border: 1px solid black; /**테두리**/
padding: 3px; /**안쪽여백**/
filter: progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)
}
</style>

[2단계] 아래의 코드를 <body> 와 </body> 태그 사이에 붙여 넣으세요.

<script type="text/javascript">
var tickercontents=new Array()

/** 아래의 방식으로 출력할 메세지들을 설정 하세요 **/
tickercontents[0]='1) <a href="http://">웹미니쩜넷</a>- 홈페이지 디자인 관련 자료</a>'
tickercontents[1]='2) <a href="http://www.naver.com">네이버 홈페이지</a>- 네이버 검색 엔진</a>'
tickercontents[2]='3) <a href="http://www.yahoo.co.kr">야후 코리아</a>- Yahoo!!</a>'
tickercontents[3]='4) <a href="http://www.dreamwiz.com">드림위즈</a>- 드림위즈 홈페이지</a>'

var persistlastviewedmsg=1 // 세로고침을 할때 기존의 메세지 다음부터 보여줄지, 아니면 처음부터 보여줄지 여부 (0 혹은 1)
var persistmsgbehavior="onload" // "onload" 혹은 "onclick" 으로 설정 할 수 있습니다

// 메세지별로 지연시간을 설정 하세요
var tickdelay=3000

var divonclick=(persistlastviewedmsg && persistmsgbehavior=="onclick")? 'onClick="savelastmsg()" ' : ''
var currentmessage=0

function changetickercontent(){
if (crosstick.filters && crosstick.filters.length>0)
crosstick.filters[0].Apply()
crosstick.innerHTML=tickercontents[currentmessage]
if (crosstick.filters && crosstick.filters.length>0)
crosstick.filters[0].Play()
currentmessage=(currentmessage==tickercontents.length-1)? currentmessage=0 : currentmessage+1
var filterduration=(crosstick.filters&&crosstick.filters.length>0)? crosstick.filters[0].duration*1000 : 0
setTimeout("changetickercontent()",tickdelay+filterduration)
}

function beginticker(){
if (persistlastviewedmsg && get_cookie("lastmsgnum")!="")
revivelastmsg()
crosstick=document.getElementById? document.getElementById("memoryticker") : document.all.memoryticker
changetickercontent()
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function savelastmsg(){
document.cookie="lastmsgnum="+currentmessage
}

function revivelastmsg(){
currentmessage=parseInt(get_cookie("lastmsgnum"))
currentmessage=(currentmessage==0)? tickercontents.length-1 : currentmessage-1
}

if (persistlastviewedmsg && persistmsgbehavior=="onload")
window.onunload=savelastmsg

if (document.all||document.getElementById)
document.write('<div id="memoryticker" '+divonclick+'></div>')
if (window.addEventListener)
window.addEventListener("load", beginticker, false)
else if (window.attachEvent)
window.attachEvent("onload", beginticker)
else if (document.all || document.getElementById)
window.onload=beginticker

</script>
profile 글쓴이 빽짱구

단점이 없는 사람은 장점도 거의 없다 - 에이브러햄 링컨

엮인글 :
https://web.webmini.net/javascript/14399/328/trackback
소중한 댓글 부탁드립니다.
추천수 10단위당 메달이 1개씩 노출되고, 추천수에 따라 배경색이 변하며, 일정수의 추천수를 받을시 BEST 아이콘이 붙게됩니다.
추천수에 따른 배경색 보기 본문으로 바로가기
  • 추천수 50개이상
  • 추천수 30개이상
  • 추천수 20개이상
  • 추천수 10개이상
  • 추천수 3개이상
닫기

첫번째 댓글을 남겨주세요!

List of Articles
번호 제목 글쓴이 날짜 추천 수 조회 수sort
89 hit index 페이지에 다른문서 불러오기? title: [ani]깜빡이는 표정빽짱구 2006-03-09 4 10276
88 hit 요일마다 바뀌는 상태바 인사 말 [1] title: [ani]깜빡이는 표정빽짱구 2006-05-08 12 10054
87 hit 자동으로 늘어나는 아이프레임 (익스+파폭) title: [ani]깜빡이는 표정빽짱구 2010-02-10   10018
86 best of best 타이틀을 랜덤으로 바꾸기 title: [ani]깜빡이는 표정빽짱구 2006-03-28 29 9810
85 best of best 스크롤되는 배너 title: [ani]깜빡이는 표정빽짱구 2005-03-26 21 9659
84 상태표시줄 링크주소 안보이게 하기 title: [ani]깜빡이는 표정빽짱구 2004-02-28 13 9569
83 하루동안 팝업창 띄우지 않기 title: [ani]깜빡이는 표정빽짱구 2005-02-23 8 9485
82 따라다니는 레이어 [4] title: [ani]깜빡이는 표정빽짱구 2009-10-09   9471
81 자바스크립트로 부드럽게 창제어하기 title: [ani]깜빡이는 표정빽짱구 2006-01-07 12 9133
80 롤링 자동 스크립트 웹기프트 2010-11-13   9124
79 제홈에 쓰인 마우스 오른쪽 금지태그 title: [ani]깜빡이는 표정빽짱구 2004-03-31 10 8958
78 '베너가져가기' 클릭 시 "소스"가 복사되는 스크립트 정천 2010-03-05 1 8671
77 새로고침할때마다 바뀌는 랜덤배너 소스 title: [ani]깜빡이는 표정빽짱구 2011-07-21   8470
76 best of best 제자리에서 페이딩되면서 바뀌며보여주는 뉴스티커 title: [ani]깜빡이는 표정빽짱구 2006-01-07 32 8458
75 브라우저를 동적으로 부드럽게 리사이징하기 title: [ani]깜빡이는 표정빽짱구 2006-02-05 14 8339
74 카피라이터에 년도를 자동으로 바꿔주자! [5] title: [ani]깜빡이는 표정빽짱구 2010-02-08   8282
73 타이핑 텍스트 12 (뉴스티커 기능) [4] 웹준 2009-11-04   8247
72 자바스크립트 암호방법들 file 혁이 2010-04-23   8203
71 익스플로어 상태 표시줄에 스크립트 에러 경고 없애기 title: [ani]깜빡이는 표정빽짱구 2005-01-20 13 8137
70 이미지 클릭시 최적사이즈로 팝업 열리게 하는 스크립트 늘푸른 2010-07-24   8130