资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
javascript实现的多条新闻公告系统
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>公告系统</TITLE> <META http-equiv=Content-Type content="text/html; charset=gb2312"><!-- 原始颜色#5A614A --> <STYLE type=text/css>A:visited { COLOR: #5a614a; TEXT-DECORATION: none } A:link { COLOR: #5a614a; TEXT-DECORATION: none } A:hover { LEFT: 1px; FONT-FAMILY: 宋体; POSITION: relative; TOP: 1px } BODY { FONT-SIZE: 9pt; MARGIN: 0px; TEXT-ALIGN: left } </STYLE> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3CSCRIPT%20language%3DJAVAscript%3E%20%0D%0A%3C!--%20%0D%0A%2F%2F%20------%20%E5%AE%9A%E4%B9%89%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F%20%0D%0A%20%20%20%20%20%20%20var%20theNewsNum%3B%20%0D%0A%20%20%20%20var%20theAddNum%3B%20%0D%0A%20%20%20%20var%20totalNum%3B%20%0D%0A%20%20%20%20var%20CurrentPosion%3D0%3B%20%0D%0A%20%20%20%20%20%20%20var%20theCurrentNews%3B%20%0D%0A%20%20%20%20%20%20%20var%20theCurrentLength%3B%20%0D%0A%20%20%20%20%20%20%20var%20theNewsText%3B%20%0D%0A%20%20%20%20%20%20%20var%20theTargetLink%3B%20%0D%0A%20%20%20%20%20%20%20var%20theCharacterTimeout%3B%20%0D%0A%20%20%20%20%20%20%20var%20theNewsTimeout%3B%20%0D%0A%20%20%20%20%20%20%20var%20theBrowserVersion%3B%20%0D%0A%20%20%20%20%20%20%20var%20theWidgetOne%3B%20%0D%0A%20%20%20%20%20%20%20var%20theWidgetTwo%3B%20%0D%0A%20%20%20%20%20%20%20var%20theSpaceFiller%3B%20%0D%0A%20%20%20%20%20%20%20var%20theLeadString%3B%20%0D%0A%20%20%20%20%20%20%20var%20theNewsState%3B%20%0D%0A%20%20%20%20%20%20%20function%20startTicker()%20%0D%0A%20%20%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0D%0A%2F%2F%20------%20%E8%AE%BE%E7%BD%AE%E5%88%9D%E5%A7%8B%E6%95%B0%E5%80%BC%20%0D%0A%20%20%20%20%20%20%20%20%20%20theCharacterTimeout%20%3D%2050%3B%2F%2F%E5%AD%97%E7%AC%A6%E9%97%B4%E9%9A%94%E6%97%B6%E9%97%B4%20%0D%0A%20%20%20%20%20%20%20%20%20%20theNewsTimeout%20%20%20%20%20%3D%203000%3B%2F%2F%E6%96%B0%E9%97%BB%E9%97%B4%E9%9A%94%E6%97%B6%E9%97%B4%20%0D%0A%20%20%20%20%20%20%20%20%20%20theWidgetOne%20%20%20%20%20%20%20%20%3D%20%20%22_%22%3B%2F%2F%E6%96%B0%E9%97%BB%E5%89%8D%E9%9D%A2%E4%B8%8B%E6%A0%87%E7%AC%A61%20%0D%0A%20%20%20%20%20%20%20%20%20%20theWidgetTwo%20%20%20%20%20%20%20%20%3D%20%20%22-%22%3B%2F%2F%E6%96%B0%E9%97%BB%E5%89%8D%E9%9D%A2%E4%B8%8B%E6%A0%87%E7%AC%A6%20%0D%0A%20%20%20%20%20%20%20%20%20%20theNewsState%20%20%20%20%20%20%20%3D%201%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%2F%2FtheNewsNum%20%20%20%20%20%20%20%20%3D%20document.body.children.incoming.children.NewsNum.innerText%3B%2F%2F%E6%96%B0%E9%97%BB%E6%80%BB%E6%9D%A1%E6%95%B0%20%0D%0A%20%20%20%20%20%20%20%20%20%20%2F%2Fadd%20by%20lin%20%0D%0A%20%20%20%20%20theNewsNum%20%20%20%20%20%20%20%20%3D%20document.getElementById(%22incoming%22).children.AllNews.children.length%3B%2F%2F%E6%96%B0%E9%97%BB%E6%80%BB%E6%9D%A1%E6%95%B0%20%0D%0A%20%20%20%20%20theAddNum%20%20%20%20%20%20%20%20%3D%20document.getElementById(%22incoming%22).children.AddNews.children.length%3B%2F%2F%E8%A1%A5%E5%85%85%E6%9D%A1%E6%95%B0%20%0D%0A%20%20%20%20%20totalNum%20%20%20%3DtheNewsNum%2BtheAddNum%3B%20%0D%0A%20%20%20%20%20theCurrentNews%20%20%20%20%20%3D%200%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20theCurrentLength%20%20%20%20%3D%200%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20theLeadString%20%20%20%20%20%20%20%3D%20%22%20%22%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20theSpaceFiller%20%20%20%20%20%20%3D%20%22%20%22%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20runTheTicker()%3B%20%0D%0A%20%20%20%20%20%20%20%7D%20%0D%0A%2F%2F%20---%20%E5%9F%BA%E7%A1%80%E5%87%BD%E6%95%B0%20%0D%0A%20%20%20%20%20%20%20function%20runTheTicker()%20%0D%0A%20%20%20%20%20%20%20%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20if(theNewsState%20%3D%3D%201)%20%0D%0A%20%20%20%20%20%20%20%20%20%20%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if(CurrentPosion%3CtheNewsNum)%7B%20%20%0D%0A%20%20%20%20%20%20%20%20%20%20setupNextNews()%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20else%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20setupAddNews()%3B%20%0D%0A%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20CurrentPosion%2B%2B%3B%20%0D%0A%20%20%20%20%20%20if(CurrentPosion%3E%3DtotalNum%7C%7CCurrentPosion%3E%3D5)%20CurrentPosion%3D0%3B%20%20%2F%2F%E6%9C%80%E5%A4%9A%E6%9D%A1%E6%95%B0%E4%B8%8D%E8%B6%85%E8%BF%875%E6%9D%A1%20%0D%0A%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20%20%20%20if(theCurrentLength%20!%3D%20theNewsText.length)%20%0D%0A%20%20%20%20%20%20%20%20%20%20%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20drawNews()%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20%20%20%20else%20%0D%0A%20%20%20%20%20%20%20%20%20%20%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20closeOutNews()%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20%7D%20%0D%0A%2F%2F%20---%20%E8%B7%B3%E8%BD%AC%E4%B8%8B%E4%B8%80%E6%9D%A1%E6%96%B0%E9%97%BB%20%0D%0A%20%20%20%20%20%20%20function%20setupNextNews()%20%0D%0A%20%20%20%20%20%20%20%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20theNewsState%20%3D%200%3B%20%0D%0A%20%20%20%20%20theCurrentNews%20%3D%20theCurrentNews%20%25%20theNewsNum%3B%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20%20%20theNewsText%20%3D%20document.getElementById(%22AllNews%22).children%5BtheCurrentNews%5D.children.Summary.innerText%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20theTargetLink%20%3D%20document.getElementById(%22AllNews%22).children%5BtheCurrentNews%5D.children.NewsLink.innerText%3B%20%20%20%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20%20%20theCurrentLength%20%3D%200%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20document.all.hottext.href%20%3D%20theTargetLink%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20theCurrentNews%2B%2B%3B%20%0D%0A%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20function%20setupAddNews()%20%0D%0A%20%20%20%20%20%20%20%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20theNewsState%20%3D%200%3B%20%0D%0A%20%20%20%20%20theCurrentNews%20%3D%20theCurrentNews%20%25%20theAddNum%3B%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20%20%20theNewsText%20%3D%20document.getElementById(%22incoming%22).children.AddNews.children%5BtheCurrentNews%5D.children.Summary.innerText%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20theTargetLink%20%3D%20document.getElementById(%22incoming%22).children.AddNews.children%5BtheCurrentNews%5D.children.NewsLink.innerText%3B%20%20%20%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20%20%20theCurrentLength%20%3D%200%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20document.all.hottext.href%20%3D%20theTargetLink%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20theCurrentNews%2B%2B%3B%20%0D%0A%20%20%20%20%7D%20%20%20%20%20%0D%0A%2F%2F%20---%20%E6%BB%9A%E5%8A%A8%E6%96%B0%E9%97%BB%20%0D%0A%20%20%20%20%20%20%20function%20drawNews()%20%0D%0A%20%20%20%20%20%20%20%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20var%20myWidget%3B%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20%20%20%20%20%20%20if((theCurrentLength%20%25%202)%20%3D%3D%201)%20%0D%0A%20%20%20%20%20%20%20%20%20%20%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20myWidget%20%3D%20theWidgetOne%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20%20%20%20else%20%0D%0A%20%20%20%20%20%20%20%20%20%20%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20myWidget%20%3D%20theWidgetTwo%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%20%20%20%20document.all.hottext.innerHTML%20%3D%20theLeadString%20%2B%20theNewsText.substring(0%2CtheCurrentLength)%20%2B%20myWidget%20%2B%20theSpaceFiller%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20theCurrentLength%2B%2B%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20setTimeout(%22runTheTicker()%22%2C%20theCharacterTimeout)%3B%20%0D%0A%20%20%20%20%20%20%20%7D%20%0D%0A%2F%2F%20---%20%E7%BB%93%E6%9D%9F%E6%96%B0%E9%97%BB%E5%BE%AA%E7%8E%AF%20%0D%0A%20%20%20%20%20%20%20function%20closeOutNews()%20%0D%0A%20%20%20%20%20%20%20%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20document.all.hottext.innerHTML%20%3D%20theLeadString%20%2B%20theNewsText%20%2B%20theSpaceFiller%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20theNewsState%20%3D%201%3B%20%0D%0A%20%20%20%20%20%20%20%20%20%20setTimeout(%22runTheTicker()%22%2C%20theNewsTimeout)%3B%20%0D%0A%20%20%20%20%20%20%20%7D%20%20%20%20%20%20%20%0D%0Awindow.onload%3DstartTicker%3B%20%20%20%20%20%20%20%20%20%0D%0A%2F%2F--%3E%20%0D%0A%3C%2FSCRIPT%3E"> <!-- 一种文字颜色渐变效果的超级连接特效 --> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3CSCRIPT%3E%20%0D%0A%3C!--%20%0D%0Adocument.onmouseover%20%3D%20domouseover%3B%20%0D%0Adocument.onmouseout%20%3D%20domouseout%3B%20%0D%0A%0D%0Afunction%20domouseover()%20%7B%20%0D%0A%20%20if(document.all)%7B%20%0D%0A%20%20srcElement%20%3D%20window.event.srcElement%3B%20%0D%0A%20%20if%20(srcElement.className.indexOf(%22fade%22)%20%3E%20-1)%20%7B%20%0D%0A%20%20%20%20%20%20%20%20var%20linkName%20%3D%20srcElement.name%3B%20%0D%0A%20%20%20%20%20%20fadein(linkName)%3B%20%0D%0A%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%7D%20%0D%0A%7D%20%0D%0A%0D%0Afunction%20domouseout()%20%7B%20%0D%0A%20%20if%20(document.all)%7B%20%0D%0A%20%20srcElement%20%3D%20window.event.srcElement%3B%20%0D%0A%20%20if%20(srcElement.className.indexOf(%22fade%22)%20%3E%20-1)%20%7B%20%0D%0A%20%20%20%20%20%20%20%20var%20linkName%20%3D%20srcElement.name%3B%20%0D%0A%20%20%20%20%20%20fadeout(linkName)%3B%20%0D%0A%20%20%20%20%20%20%7D%20%0D%0A%20%20%20%20%20%20%7D%20%0D%0A%7D%20%0D%0A%0D%0Afunction%20makearray(n)%20%7B%20%0D%0A%20%20%20%20this.length%20%3D%20n%3B%20%0D%0A%20%20%20%20for(var%20i%20%3D%201%3B%20i%20%3C%3D%20n%3B%20i%2B%2B)%20%0D%0A%20%20%20%20%20%20%20%20this%5Bi%5D%20%3D%200%3B%20%0D%0A%20%20%20%20return%20this%3B%20%0D%0A%7D%20%0D%0A%0D%0Ahexa%20%3D%20new%20makearray(16)%3B%20%0D%0Afor(var%20i%20%3D%200%3B%20i%20%3C%2010%3B%20i%2B%2B)%20%0D%0A%20%20%20%20hexa%5Bi%5D%20%3D%20i%3B%20%0D%0Ahexa%5B10%5D%3D%22a%22%3B%20hexa%5B11%5D%3D%22b%22%3B%20hexa%5B12%5D%3D%22c%22%3B%20%0D%0Ahexa%5B13%5D%3D%22d%22%3B%20hexa%5B14%5D%3D%22e%22%3B%20hexa%5B15%5D%3D%22f%22%3B%20%0D%0A%0D%0Afunction%20hex(i)%20%7B%20%0D%0A%20%20%20%20if%20(i%20%3C%200)%20%0D%0A%20%20%20%20%20%20%20%20return%20%2200%22%3B%20%0D%0A%20%20%20%20else%20if%20(i%20%3E%20255)%20%0D%0A%20%20%20%20%20%20%20%20return%20%22ff%22%3B%20%0D%0A%20%20%20%20else%20%0D%0A%20%20%20%20%20%20%20return%20%22%22%20%2B%20hexa%5BMath.floor(i%2F16)%5D%20%2B%20hexa%5Bi%2516%5D%3B%7D%20%0D%0A%0D%0Afunction%20setbgColor(r%2C%20g%2C%20b%2C%20element)%20%7B%20%0D%0A%20%20%20%20%20%20var%20hr%20%3D%20hex(r)%3B%20var%20hg%20%3D%20hex(g)%3B%20var%20hb%20%3D%20hex(b)%3B%20%0D%0A%20%20%20%20%20%20element.style.color%20%3D%20%22%23%22%2Bhr%2Bhg%2Bhb%3B%20%0D%0A%7D%20%0D%0A%0D%0Afunction%20fade(sr%2C%20sg%2C%20sb%2C%20er%2C%20eg%2C%20eb%2C%20step%2C%20direction%2C%20element)%7B%20%0D%0A%20%20%20%20for(var%20i%20%3D%200%3B%20i%20%3C%3D%20step%3B%20i%2B%2B)%20%7B%20%0D%0AsetTimeout(%22setbgColor(Math.floor(%22%20%2Bsr%2B%20%22%20*((%20%22%20%2Bstep%2B%20%22%20-%20%22%20%2Bi%2B%20%22%20)%2F%20%22%20%2Bstep%2B%20%22%20)%20%2B%20%22%20%2Ber%2B%20%22%20*%20(%22%20%2Bi%2B%20%22%2F%22%20%2Bstep%2B%20%22))%2CMath.floor(%22%20%2Bsg%2B%20%22%20*%20((%20%22%20%2Bstep%2B%20%22%20-%20%22%20%2Bi%2B%20%22%20)%2F%20%22%20%2Bstep%2B%20%22%20)%20%2B%20%22%20%2Beg%2B%20%22%20*%20(%22%20%2Bi%2B%20%22%2F%22%20%2Bstep%2B%20%22))%2CMath.floor(%22%20%2Bsb%2B%20%22%20*%20((%22%20%2Bstep%2B%20%22-%22%20%2Bi%2B%20%22)%2F%22%20%2Bstep%2B%20%22)%20%2B%20%22%20%2Beb%2B%20%22%20*%20(%22%20%2Bi%2B%20%22%2F%22%20%2Bstep%2B%20%22))%2C%22%2Belement%2B%22)%3B%22%2Ci*step)%3B%20%0D%0A%20%20%20%20%7D%20%0D%0A%7D%20%0D%0A%0D%0Afunction%20fadeout(element)%20%7B%20%0D%0A%20%20%20%20%20%20%20%20%20%20%20%0D%0A%20%20%20%20fade(255%2C153%2C0%2C%200%2C0%2C0%2C%2030%2C%201%2C%20element)%3B%20%0D%0A%7D%20%0D%0A%0D%0A%2F*------------------%3D%5Bfadein%5D%3D----------------------%20%0D%0A%7C%7CFades%20the%20text%20from%20one%20color%20to%20another%20color%20%20%20%7C%7C%20%0D%0A%7C%7Cwhen%20the%20mouse%20moves%20over%20the%20link.%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7C%7C%20%0D%0A%7C%7C-------------------------------------------------*%2F%20%0D%0A%0D%0Afunction%20fadein(element)%20%7B%20%0D%0A%0D%0A%20%20%20%20fade(0%2C0%2C0%2C%20255%2C153%2C0%2C%2018%2C%201%2C%20element)%3B%20%0D%0A%7D%20%0D%0A%2F*ignore%20this%20%3E%3E%3E%3E*%2F%20%0D%0Afunction%20fadeIn2(id)%7B%20%0D%0A%20%20%20%20fade(255%2C255%2C255%2C%2088%2C118%2C152%2C%2025%2C%201%2C%20id)%3B%20%0D%0A%7D%20%0D%0A%0D%0Afunction%20fadeOut2(id)%7B%20%0D%0A%20%20%20%20fade(88%2C118%2C152%2C%20255%2C255%2C255%2C%2029%2C%201%2C%20id)%3B%20%0D%0A%7D%20%0D%0A%2F*%3C%3C%3C%3C%3C%20stop%20ignoring%20%3D)*%2F%20%0D%0A%0D%0A%0D%0A%2F%2F%20--%3E%20%0D%0A%3C%2FSCRIPT%3E"> <META content="MSHTML 6.00.3790.4064" name=GENERATOR></HEAD> <BODY bgColor=#fdf4bc> <DIV id=visible><FONT color=#ff6910>公告一句话:<A class=fade id=hottext href="http://www.glzy8.com/" _ewebeditor_ta_href="http%3A%2F%2Fwww.glzy8.com%2F" target=_blank name=a></A></DIV> <DIV id=incoming style="DISPLAY: none"> <DIV id=AllNews> <DIV id=1> <DIV id=Summary>1.应广大热爱本站的朋友的要求,本站已正式推出了"清萍学堂",专门制作视频教程给大家参考学习。 - 2007-7-10</DIV> <DIV id=NewsLink>fq/qpxt/</DIV></DIV> <DIV id=2> <DIV id=Summary>2.本站第一期电子杂志"flash特效"出世了,精美的画面、精美的内容、优美动听的音乐等你欣赏。 - 2007-5-31</DIV> <DIV id=NewsLink>flash/zazhi/</DIV></DIV> <DIV id=3> <DIV id=Summary>3.本站下载中心和关于我们已经成功改版了,两个风格都是以古典优雅、高风侠义为表现。 - 2007-7-1</DIV> <DIV id=NewsLink>/fq/</DIV></DIV> <DIV id=4> <DIV id=Summary>4.长期寻求QQ空间flash、flash网站、flash片头等业务制作,价格便宜、服务周到。- 2006-10-21</DIV> <DIV id=NewsLink>images/yewu.htm</DIV></DIV> <DIV id=5> <DIV id=Summary>5.★强烈推荐大家一款高速稳定、透明代理,安全的英文google浏览器。 点击即可下载→</DIV> <DIV id=NewsLink></DIV></DIV></DIV> <DIV id=AddNews></DIV></DIV></BODY></HTML>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程