<!DOCTYPE html>
<html>
<head>
<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(function(){
$("p").click(function(){
$(this).hide();
});
var msg = "0";
$("#btn").click(function(){
msg = "1";
alert("step1: "+msg);
getdata(msg);
//msg = getdata(msg);
alert("step3: "+msg);
});
function getdata(msg){
msg = "2";
alert("step2: "+msg);
return msg;
}
});
</script>
<style>
p{cursor:pointer;}
.gradient{
background: #104E8B;
background: -moz-linear-gradient(top, #104E8B 0%, #AEEEEE 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#AEEEEE), color-stop(100%,#AEEEEE));
background: -webkit-linear-gradient(top, #104E8B 0%,#AEEEEE 100%);
background: -o-linear-gradient(top, #104E8B 0%,#AEEEEE 100%);
background: -ms-linear-gradient(top, #104E8B 0%,#AEEEEE 100%);
background: linear-gradient(to bottom, #104E8B 0%,#AEEEEE 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#104E8B', endColorstr='#AEEEEE',GradientType=0 );
}
:root .gradient{filter:none;}
</style>
</head>
<body>
<p>如果您点击我,我会消失。</p>
<p>点击我,我会消失。</p>
<p>也要点击我哦。</p>
<input type="button" value="click" id="btn" />
<div style="width:500px;height:500px;" class="gradient"></div>
</body>
</html>
jQuery参数传递赋值的问题
最新推荐文章于 2022-08-26 22:32:15 发布