每日jsp 特效(一) 产生随机的颜色

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
	<head>
	<script src="../js/jquery-1.4.3.js"></script>
	
	<style type="text/css">
	#bnt{
	font-family: Verdana,Geneva,sans-serif;
    font-size: 32px;
	padding: 15px 30px;
	background: none repeat scroll 0% 0% rgb(188, 25, 57);
	color: rgb(249, 250, 250);
	text-decoration: none;
	border-top: 1px solid rgb(201, 70, 96);
	border-left: 1px solid rgb(201, 70, 96);
	text-shadow: 1px 2px 0px rgb(131, 17, 39);
	box-shadow: 1px 0px 0px rgb(131, 17, 39), 0px 1px 0px rgb(131, 17, 39), 2px 1px 0px rgb(131, 17, 39), 1px 2px 0px rgb(131, 17, 39), 3px 2px 0px rgb(131, 17, 39), 2px 3px 0px rgb(131, 17, 39), 4px 3px 0px rgb(131, 17, 39), 3px 4px 0px rgb(131, 17, 39), 4px 4px 2px rgb(0, 0, 0);
	}
	#button_container {
    text-align: center;
    margin: 100px auto;
        margin-top: 100px;
        margin-right-value: auto;
        margin-bottom: 100px;
        margin-left-value: auto;
        margin-left-ltr-source: physical;
        margin-left-rtl-source: physical;
        margin-right-ltr-source: physical;
        margin-right-rtl-source: physical;
}
	</style>
	<script>
	$(function() {
		$("#body").css("background","#E0EEEE");
		$("#bnt")
				.click(
						function() { // 产生随机的颜色
							var a=Math.round(Math.random()*0x1000000);
							var c="00000".concat(a.toString(16));
							bgColor="#"+c.substr(c.length-6,6);
							$("#body").css("background",bgColor);
							
						});
	});
	</script>
		<title>点击变换颜色</title>
	</head>
	<body id="body">
		<div id="button_container">
	<button id="bnt" >click</button>
	</div>
	</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值