每日jsp 特效 点击某颜色覆盖某面板

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
	<head>
	<script src="../js/jquery-1.4.3.js"></script>
	<style>
	#center{
	background-color: #FFFFE0;
    box-shadow: 0 0 8px #000000;
    margin: 0 auto;
    padding: 40px;
    width: 850px;
	height:550px;
	}
	#title{
	color: #333333;
    font-family: "Century Gothic",CenturyGothic,AppleGothic,sans-serif;
    font-size: 38px;
    padding: 30px 0;
    text-align: center;
    text-shadow: -1px -1px 0 rgba(255, 255, 255, 0.5), 1px 1px 0 rgba(0, 0, 0, 0.5);
	
	}
	.color {
    border: 1px solid #AAAAAA;
    cursor: pointer;  /*这句话的意思是:意思就是鼠标指针变成 手 的形状,和放到链接上面的鼠标指针一样*/
    height: 50px;
    margin-bottom: 20px;
    width: 50px;
    }
    #right{
   border: 1px solid #333333;
    float: right;
    height: 500px;
    width: 700px;
    }
    .row{
     border: 1px solid #333333;
    }
    #table li{
	float:left;
	height: 165px;
    width: 349px;
	list-style:none outside;
	border-bottom:#999999 1px solid;
	border-right:#999999 1px solid;
	text-align:center;
}
	</style>
	<script>
	$(function(){
		var color;
		$(".color").click(
				function (){
			 color=$(this).attr("style");
			
		});
		$("#table li").click(
		 function (){
			 $(this).attr("style",color);
		 }		
		);
	} );
	
	
	</script>
		<title>点击一个颜色覆盖面板</title>
	</head>
	<body >
	<div id="title"> 点击你想点击的颜色,涂写面板</div>
	<div id="center">
	<div style="float:left">
	<div class="color"  style="background:red"></div>
	<div class="color"style="background:blue"></div>
	<div class="color" style="background:black"></div>
	<div class="color" style="background:yellow"></div>
	</div>
	<div id="right">
	<div id="table">
	<li></li>
	<li></li>
	<li></li>
	<li></li>
	<li></li>
	<li></li>
</div>
</div>
	</div>
		
	</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值