zoukankan      html  css  js  c++  java
  • 随机标签云

    html:
    <div class="hot-tag">
            <h2>热门标签</h2>
            <ul class="wrap-tag">
                <a href="#">傻白甜</a>
                <a href="#">小清新</a>
                <a href="#">文艺范</a>
                <a href="#">佛系</a>
                <a href="#">森女系</a>
                <a href="#">重金属</a>
                <a href="#">萌萌哒</a>
                <a href="#">摄影控</a>
                <a href="#">清风</a>
                <a href="#">萤火之森</a>
                <a href="#">治愈系</a>
                <a href="#">温情路线</a>
            </ul>
          </div>
    js:
    //随机方法
    function rand(num){
    return parseInt(Math.random()*num);
    }
    //随机颜色
    function randomcolor(){
    var colorAll=['f44336','ffab00','11c9c5','8fc31f','31afe9','b5a1eb','659fee','75ce49','ff5252','ff6d00','7c87c9']//随机颜色的取值范围
    var str=rand(11)
    return colorAll[str];
    }
    var obox=$(".wrap-tag");
    var obj=$(".wrap-tag a");
    for( len=obj.length,i=len;i--;){
    obj[i].className="color"+rand(5);
    obj[i].style.fontSize=rand(6)+12+"px";
    obj[i].style.color="#"+randomcolor();
    }
    --写于一个加班的周末
  • 相关阅读:
    Java开发web的几种开发模式
    Tomcat7.0安装配置
    Apache与Tomcat 区别联系
    编写 Window 服务程序
    系列文章--SharePoint 开发教程
    Google Chrome浏览器调试功能介绍
    Chrome的JS调试工具
    Google Chrome 调试JS简单教程[更新]
    ASP.NET常用标准配置web.config
    WINDOWS下kill进程的命令
  • 原文地址:https://www.cnblogs.com/wszxx/p/10292172.html
Copyright © 2011-2022 走看看