摘要: http://www.w3school.com.cn/jquery/jquery_ajax_intro.asp $(document),$(body) 加载事件: $(document).ready(fn) $(document).ready(function(){ alert("这是加载事件"); 阅读全文
posted @ 2019-05-16 20:04 ellenxx 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 基本 1 show(可加时间)显示【在效果完成后可执行函数】 2 hide(可加时间)隐藏 3 toggle():切换效果 【在show和hide中切换】 有函数时 滑动动画 1 slideDown:下滑,显示 2 slideUp:收起,隐藏 3 slideToggle:切换效果 淡入淡出动画 1 阅读全文
posted @ 2019-05-16 20:04 ellenxx 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 内部插入:父子级关系 1 $(a).append($(b))把b插入到a里面(a里面的面后) $("div").append($("<p>段落</p>")); 2 $(b).appendTo($(a)):把b放到a里面(a里面的后面) 3 $(a).prepend($(b)):把b插入到a中(a里面 阅读全文
posted @ 2019-05-16 20:03 ellenxx 阅读(179) 评论(0) 推荐(0) 编辑
摘要: html代码 1.html():获取的是对象内的html代码,类似于innerHTML 2.html(代码):设置html的内容,替换 $("div").html("hhhhh"); $("div").html("<p>hhhh</p>"); ps:html要识别标签 text:标签中的文本内容 标 阅读全文
posted @ 2019-05-16 20:01 ellenxx 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 1 addClass(classname) 添加类 <script type="text/javascript"> $("input").click(function() { $("div").addClass("abcd") ; }); </script> 2 removeClass(classn 阅读全文
posted @ 2019-05-16 20:00 ellenxx 阅读(122) 评论(0) 推荐(0) 编辑
摘要: ps:所有元素要加上“” 属性: 1) attr:属性,元素.attr(); 获取属性 $("input").click(function(){ console.log($("img").attr("src")); }); 2) attr(attr,value) :设置属性 $("input").a 阅读全文
posted @ 2019-05-16 19:59 ellenxx 阅读(673) 评论(0) 推荐(0) 编辑
摘要: jquery:核心,内容 语法:$(select).action(); console.log:控制台日志,将想要的东西打印出来 选择器,事件,DOM,动画,基本操作,插件,ajax 基本选择器 #id:id选择器:$("#id名") element:元素选择器 class:类选择器 selecto 阅读全文
posted @ 2019-05-16 19:58 ellenxx 阅读(264) 评论(0) 推荐(0) 编辑