<%@ 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>
每日jsp 特效(一) 产生随机的颜色
最新推荐文章于 2022-06-15 23:24:57 发布