js 变动首页参与人数

<span class="float_r" style="background:none;">注册就有<strong style="color:#fc5004; font-family:Microsoft Yahei; font-size:16px;" id="user_number">19548332</strong>人陪你玩</span>
View Code

 

 js:

<script type="text/javascript">

// 增加user_number
add_user_number();
setInterval("add_user_number()", 2000);

function add_user_number()
{
    var rand = Math.random()*5;
    var number = $("#user_number").html();
    number = parseInt(number)+parseInt(rand);
    $("#user_number").html(number);
}
</script>
View Code

 

posted on 2013-05-24 11:53  douqiumiao  阅读(166)  评论(0编辑  收藏  举报