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/6cb/trackback
소중한 댓글 부탁드립니다.
추천수 10단위당 메달이 1개씩 노출되고, 추천수에 따라 배경색이 변하며, 일정수의 추천수를 받을시 BEST 아이콘이 붙게됩니다.
추천수에 따른 배경색 보기 본문으로 바로가기
  • 추천수 50개이상
  • 추천수 30개이상
  • 추천수 20개이상
  • 추천수 10개이상
  • 추천수 3개이상
닫기

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

List of Articles
번호 제목 글쓴이 날짜 추천 수sort 조회 수
69 hit 요일마다 바뀌는 상태바 인사 말 [1] title: [ani]깜빡이는 표정빽짱구 2006-05-08 12 10054
68 자바스크립트로 부드럽게 창제어하기 title: [ani]깜빡이는 표정빽짱구 2006-01-07 12 9133
67 새로운창 띄우기 title: [ani]깜빡이는 표정빽짱구 2004-03-07 12 6799
66 상태표시줄을 바꿔보자6 (시간넣기) title: [ani]깜빡이는 표정빽짱구 2004-02-07 12 4692
65 바탕화면에 주소 자동생성 title: [ani]깜빡이는 표정빽짱구 2004-05-04 11 7126
64 타이틀바 상태표시줄에 이름나타내기 title: [ani]깜빡이는 표정빽짱구 2004-05-04 11 6809
63 마우스 오른쪽 단추클릭시 경고창 띠우기 title: [ani]깜빡이는 표정빽짱구 2004-04-05 11 5473
62 플래쉬효과 문자 title: [ani]깜빡이는 표정빽짱구 2004-02-29 11 5882
61 F11키 막기 스크립트 title: [ani]깜빡이는 표정빽짱구 2006-03-05 10 7781
60 해당셀로 따라다니는 화살표 title: [ani]깜빡이는 표정빽짱구 2005-12-04 10 6278
59 선택복사하기 title: [ani]깜빡이는 표정빽짱구 2004-04-22 10 5857
58 상태표시줄 한글자씩 나타내기 title: [ani]깜빡이는 표정빽짱구 2004-04-21 10 5468
57 제홈에 쓰인 마우스 오른쪽 금지태그 title: [ani]깜빡이는 표정빽짱구 2004-03-31 10 8958
56 마우스 따라다니는 아날로그 시계 title: [ani]깜빡이는 표정빽짱구 2004-02-29 10 5463
55 아이프레임시 스크롤바 길게 늘어나기. [2] title: [ani]깜빡이는 표정빽짱구 2004-02-11 10 5096
54 hit 팝업 띄우기 (SP2에서도) title: [ani]깜빡이는 표정빽짱구 2005-03-08 9 11289
53 양쪽으로 새창띄우기 title: [ani]깜빡이는 표정빽짱구 2005-11-28 8 6139
52 여러가지 형태로 경고창을 띄워보자 title: [ani]깜빡이는 표정빽짱구 2005-11-28 8 6424
51 하루동안 팝업창 띄우지 않기 title: [ani]깜빡이는 표정빽짱구 2005-02-23 8 9485
50 hit 클릭시 시작페이지로 설정하기 title: [ani]깜빡이는 표정빽짱구 2006-03-28 7 12989