分享JavaScript精彩网页特效实例,素材,有需要代码的可以拿来参考一下
1、随机产生文本,刷新网页即可显示随机效果。程序代码:
您最喜欢中国的哪个城市: <script language="JavaScript"> <!-- var a = Math.random() + "" var rand1 = a.charAt(5) quotes = new Array quotes[1] = '北京' quotes[2] = '上海' quotes[3] = '广州' quotes[4] = '哈尔滨' quotes[5] = '长春' quotes[6] = '武汉' quotes[7] = '沈阳' quotes[8] = '大连' quotes[9] = '呼和浩特' quotes[0] = '成都' var quote = quotes[rand1] document.write( quote ) // --> </script>