
jquery
文章平均质量分 77
tz_gx
这个作者很懒,什么都没留下…
展开
-
jquery核心 01基础
$(function(){ //找到所有 p 元素,并且这些元素都必须是 div 元素的子元素 $("div > p").html("1111"); //设置页面背景色 //$(document.body).css( "background", "red" ); //隐藏一个表单中所有元素 //$(myForm.e原创 2013-08-09 10:59:35 · 456 阅读 · 0 评论 -
iframe中js方法的调用
1:父页面调用iframe页面中的js方法原创 2014-05-19 14:41:21 · 2074 阅读 · 0 评论 -
jquery 设置输入框背景样式透明,按钮背景样式保存不变
$("document").ready(function(){ $(":input").css("background-color","transparent"); $(":button").css("background-color",""); })原创 2014-03-27 19:27:45 · 1601 阅读 · 0 评论 -
jquery 工具
$(function(){ //$.each( ['a','b','c'], function(i, n){ //alert( "Item #" + i + ": " + n );//}); //$.each( { name: "John", lang: "JS" }, function(i, n){ //alert( "Name: " + i + ", Value原创 2013-08-09 11:12:25 · 441 阅读 · 0 评论 -
jquery 动画
$(function(){ //将隐藏的段落用将近4秒的时间显示出来。。。并在之后执行一个反馈。。。 // $("p").show(4000,function(){ // $(this).text("Animation Done..."); //}); //用200毫秒将段落迅速隐藏,之后弹出一个对话框。//$("p").hide("fast",funct原创 2013-08-09 11:11:56 · 418 阅读 · 0 评论 -
jquery 文档处理
$(function(){ //取得一个包含匹配的元素集合中每一个元素的所有子元素的元素集合 //$("div").children(".selected").text("22"); //$("#b").attr('value','bbb'); //$("#a").children("#b").val("3"); //搜索所有与指定表原创 2013-08-09 11:08:49 · 519 阅读 · 0 评论 -
jquery核心 02 jQuery(html,[ownerDocument])
$(function(){ //动态创建一个 div 元素(以及其中的所有内容),并将它追加到id为"1"的元素后面 $("Hello").appendTo($("#1")); //创建一个 元素必须同时设定 type 属性。因为微软规定 元素的 type 只能写一次 $("").appendTo("body"); });原创 2013-08-09 11:01:19 · 828 阅读 · 0 评论 -
jquery 事件
$(function(){ //为每个匹配元素的特定事件绑定事件处理函数。 // $("#mm").bind("click", function(){ // alert(111); // }); //为每一个匹配元素的特定事件(像click)绑定一个一次性的事件处理函数。 // $("#mm").one("click", f原创 2013-08-09 11:10:26 · 570 阅读 · 0 评论 -
jquery css
$(function(){ //访问匹配元素的样式属性。 $("p").css({ color: "#ff0011", background: "blue" }); var offset = $("#mm").offset(); alert(offset.left); alert(offset.top); });原创 2013-08-09 11:09:35 · 467 阅读 · 0 评论 -
jquery选择器
$(function(){ //用于搜索的,通过元素的 id 属性中给定的值 //alert($("#a").text()); //根据给定的元素名匹配所有元素 //alert($("p").text()); //查找所有类是 "myClass" 的元素 //alert($(".a").text());原创 2013-08-09 11:06:09 · 402 阅读 · 0 评论 -
jquery核心 03 each(function(i)
$(function(){ // 遍历p元素的文本内容 $("p").each(function(i){ alert("第"+ (i+1) +"个P元素的内容是:" + $(this).text()); }); }); 111 22原创 2013-08-09 11:03:38 · 692 阅读 · 0 评论 -
jquery筛选
$(function(){ //向所有段落中追加一些HTML标记 $("p").append("111"); $("#1").append("111"); // $("p").prepend("22"); //从DOM中删除所有匹配的元素 $("p").remove(); });原创 2013-08-09 11:07:58 · 524 阅读 · 0 评论 -
jquery属性
$(function(){ //设置或返回被选元素的属性值 $("input[name='aa']").attr("value","2222"); //alert($("input[name='aa']").attr("value")); //alert($("input[name='aa']").val()); //删除的属性原创 2013-08-09 11:07:05 · 469 阅读 · 0 评论 -
jquery核心 04size
$(function(){ // p元素的个数 //alert($("p").size()); //alert($("p").length); //get([index]) alert($("img")[0].src); alert($("img").get(1).src);原创 2013-08-09 11:04:51 · 494 阅读 · 0 评论 -
下拉分页异步加载infinitescroll的使用
1:引入js2:js$(document).ready(function() { $('.wrapper:eq(1)').masonry({ itemSelector: '.wfc', gutterWidth: 15, columnWidth: 222, isFitWidth: true原创 2016-07-15 17:29:22 · 2172 阅读 · 0 评论