![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JQ
我的div呢
这个作者很懒,什么都没留下…
展开
-
jquery中data用法
data() 方法向被选元素附加数据,或者从被选元素获取数据。$("#div-gb").data("url");https:www.xxxx.com/xxx.jpg从元素返回数据$(selector).data(name)向被选元素附加数据$(selector).data(name,value)...原创 2019-12-18 14:38:01 · 506 阅读 · 0 评论 -
jQuery中hover两个fun(){},函数所代表的的意义及用法
jQuery中hover两个fun(){},函数所代表的的意义及用法$("#a").hover( function(){},function(){});这里的两个匿名函数是作为hover函数的参数第一个参数为鼠标悬浮时(over鼠标事件)第二个参数为鼠标离开时(out鼠标事件)$("#a").hover(function(){$('#b').show();}//双向函数,移入...原创 2019-12-18 14:22:58 · 792 阅读 · 0 评论 -
jq获取页面中所有img元素的src
attr获取所有img元素src$("document").ready(function(){ var img=$("body img"); for(var i=0;i<img.length;i++){ var n=img.get(i).src; console.log(n); }})三个方法都可获取img.get(i).srcimg[i]....原创 2019-10-15 16:42:43 · 5494 阅读 · 0 评论 -
jquery 中this和$(this),.find() 与 .children() 的区别
jquery 中this和$(this),.find() 与 .children() 的区别this与$(this)KaTeX parse error: Expected 'EOF', got '#' at position 3: ("#̲desktop a img")…(this));alert(this);}alert($(this)); 弹出的结果是[object Obj...原创 2019-09-30 09:41:03 · 7948 阅读 · 0 评论 -
index和location.href的用法
index和window.location.href的用法1、<div class="aa">111</div><div class="aa">222</div><div class="aa">333</div> $(".aa").click(function(){ var n=$(".aa").index(...原创 2019-10-10 11:04:13 · 1063 阅读 · 0 评论 -
jq中的:eq()选择器
var list_url=$(".main-3:eq(0)");获取相同名称class的指定某一个特点元素内容0为第一个相同元素以此类推...:eq(number)原创 2019-10-11 16:15:39 · 544 阅读 · 0 评论