jQuery参数传递赋值的问题
2016-05-11 18:01
477 查看
<!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 多选下拉框取值
- Jquery下拉框取值
- jquery正则表达式基础辅助式理解
- JQuery replace 替换全部
- jQuery each的简单使用
- 使用JQuery进行cookie操作
- jquery学习笔记
- jQuery DataTables的简单实现
- Jquery常用功能总结
- JQuery中,html()、text()、val()区分
- 必看的 jQuery性能优化的38个建议
- jquery与原生js比较
- jQuery validate 无法校验 kindeditor 非空
- jquery的click事件失效
- jQuery 中的事件冒泡和阻止默认行为
- jQuery插件开发
- jQuery 之 $.get、$.post、$.getJSON、$.ajax
- jquery获取和改变值
- 一些常用的jQuery插件
- Jquery AutoComplete的使用方法实例