黑白显示

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>

<style type="text/css">
.blackwhite{ filter: Gray }
</style>

<script type="text/javascript">
$(function () {
$("#btn").click(function () {
$(document.body).toggleClass("blackwhite");//所有控件
});
});
</script>
</head>
<body>
<img src="1.jpg" height="200" width="200" />
<input id="btn" type="button" style="background:red" value="转换"/>
</body>
</html>

 

posted @ 2012-02-24 15:00  zwjyx_  阅读(197)  评论(0编辑  收藏  举报