随机颜色及大小方框首页
2011-06-04 00:00
579 查看
<html> <head> <title> D2S2 HOME </title> <link rel="stylesheet" type="text/css" href="/static/accounts/css/home.css" /> <script type="text/javascript" src="/static/accounts/js/multicolor.js"></script> <script> window.onload = function() { multiColor("items"); } </script> </head> <body> <div id="menu"> <li class="top-item"><a id="home" href="/">HOME</a> <ul> <li class="items"><a href="/iapp/">iapp</a></li> <li class="items"><a href="/mtree/">mtree</a></li> <li class="items"><a href="/forms/index">forms</a></li> <li class="items"><a href="/about/">about me</a></li> </ul> </li> </div> <p><a href="./admin/">[ADMIN]</a></p> </body> </html>
multicolor.js:
/* * multiColor is a tricky toys, which changes the style * of a set of items randomly. <by rugby, 2011> */ function multiColor(className) { var lis = document.getElementsByClassName(className); var _r, _h; for (i in lis) { _r = Math.random(); _w = Math.pow(2.5, _r+2.1); lis[i].style.backgroundColor = "#" + _r.toString(16).substring(2,5); lis[i].style.height = 100/_w + "em"; lis[i].style.width = _w + "em"; } }
base.css:
body { background: #333333; } #headbar { background: #222222; border-radius: 10px 0px 0px 0px; margin: 2px; padding: 0px; } #headbar #userlist { list-style-type: none; text-align: center; padding: 2px; margin: 3px; } #userlist .usermode { height: 32px; width: 180px; padding: 1px; margin: 1px; background: #808000; display: inline-block; font: oblique small-caps 600 24px arial; text-shadow: 5px 2px 6px #222222; box-shadow: 2px 2px 5px #BB9911; border-radius: 10px 0px 0px 0px; } mainpad #iopad { width: 600px; height: 500px; background: #666666; border-radius: 0px 10px 0px 10px; border-width: 0px; margin: 3px; padding: 2px; } #sidenav { background: #7B5322; margin: 2px; padding: 4px; width: 320px; height: 600px; border-radius: 10px 2px 2px 10px; } #footbar { margin: 2px; padding: 6px; background: #222222; border-radius: 10px 2px 10px 2px; } #footbar #status { height: 60px; width: 548px; color: #FFFFFF; background: #000000; border-radius: 5px 5px 5px 5px; border-width: 0px; margin: 4px; padding: 2px; } #footbar #logo { width: 50px; height: 50px; padding: 2px; }
Screenshot:
![](http://static.oschina.net/uploads/space/2011/0604/171301_i05Z_142849.png)
相关文章推荐
- jquery随机多彩tag标签随机颜色和字号大小效果
- CSS实现块宽度随浏览器大小自动调整&获取随机颜色(前端面试题)
- ios随机生成200个位置不同,大小不同,颜色不同的圆
- dedecms tag标签实现随机颜色和字体大小
- Android 弹幕效果,随机颜色,大小,高度,内容
- 利用Windows空闲时间绘制随机大小和颜色的矩形
- JS控制字体大小中、设为首页、收藏本站功能、超链接去掉颜色
- 随机生成两个不同大小颜色的圆
- jquery实现的随机多彩tag标签随机颜色和字号大小效果
- [安卓开发]弹幕滚幕效果自定义View之BarrageView|支持点击事件|隐藏不滞留|颜色随机|大小速度范围随机
- 手指点击的地方随机生成带运动的不同颜色不同大小的圆
- jquery实现的随机多彩tag标签随机颜色和字号大小效果
- jquery随机多彩tag标签随机颜色和字号大小效果
- Dedecms实现tags云标签随机颜色与字体大小方法详解
- 4.一个字体的随机颜色及有规律的大小变化
- 通过单击字号中的“大”“中”“小”来切换不同大小的字号和通过单击不同颜色方框的图像按钮来切换不同的背景色
- Eclipse调试:改变颜色, 背景与字体大小 和xml字体调整
- GTK里的label控件 颜色 大小 等
- 生成纯字母随机编号的示例(仅大小或者小写).sql
- 设置TextView属性中的字体大小 颜色 背景色