Heim  >  Artikel  >  Web-Frontend  >  js实现的网站首页随机公告随机公告_典型特效

js实现的网站首页随机公告随机公告_典型特效

WBOY
WBOYOriginal
2016-05-16 19:16:301135Durchsuche

首页随机公告随机公告


default.html中搜索:

这里插入代码



js实现的网站首页随机公告随机公告_典型特效js实现的网站首页随机公告随机公告_典型特效<script> <BR> tips = new Array(7); <BR> tips[0] = "痛苦来临时,不要总问:“为什么偏偏是我?” ----快乐降临时,你从没问过这个问题"; <BR> tips[1] = "衡课颐鞘欠窀蛔愕姆椒ǎ鞘ヒ磺星坪螅颐腔故O率裁础?nbsp; ----西方哲学"; <BR> tips[2] = "不在于你能否找到一个理想的伴侣,而在于你能否做一个理想的伴侣。 ----美满婚姻的秘密"; <BR> tips[3] = "富丽堂皇的婚礼,可能是一种交易;朴实无华的婚礼,往往有真正的爱情。 ----贫贱夫妻情更浓"; <BR> tips[4] = "说最想说的话,干最想干的事,爱最想爱的人。 ----真正的活法"; <BR> tips[5] = "有人总是感叹找不到爱情,究其原因却是,自己那颗爱人的心长满了青苔。 ----要人爱先学会爱人"; <BR> tips[6] = "让自己的技术在更多人面前展示,并给他(她)们带方便和愉悦! ----技术员的最大理想"; <br><br> index = Math.floor(Math.random() * tips.length); <BR> document.write(tips[index]); <BR></script>

CSS文件中加入,这个就不用说了,可以自己改成自己喜欢的样式
.pop1 { background-color:#FFFF00; border:1px solid #CBDFE9; color:#247CAB; text-align:left;
height:15px; line-height:15px; position:relative; margin-bottom:10px;}
.pop1 .blank { height:15px; width:0; }
按理上来说是通用的~当然我没用每个程序都测试一下~
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn