jquery
文章平均质量分 64
_必应
不用害怕问题,有些问题可能并没有想像中的那么困难,可能最后发现只是不小心碰到了键盘呢!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
jquery 判断对象是否存在
用jquery判断一个对象是否存在不能用 if($ ("#id")){ }else{} jquery不管对象存不存在都会返回object。 应该用 if($ ("#id").length>0){}else{} or if($ ("#id")[0]){ } else { } or if(document.getElementById("id")){} else {} ...原创 2013-04-19 14:11:38 · 571 阅读 · 0 评论 -
jquery 简单两步实现tab切换效果
<script language="javascript" type="text/javascript"> <!-- $(function(){ $("a[_for]").mouseover(function(){ $(this).parents().children("dd").hide(); ...原创 2012-03-13 13:40:15 · 616 阅读 · 0 评论 -
jquery 实现多级下拉菜单
$(document).ready(function() { function megaHoverOver(){ $(this).find(".sub").stop().fadeTo('fast', 1).show(); //Calc#bhate width of all #bh's (function($...原创 2012-03-07 14:46:34 · 710 阅读 · 0 评论 -
jQuery使用时注意
选择器时属性值最好用”“,连续操作可用链式调用 dom操作时注意性能问题,不要过度依赖dom,append等放在变量中尽量一次完成插入 detach后的元素事件和数据会被保留下来,而empty,remove不会 offset相对于整个页面计算偏移,position相对于父offsetParent计算偏移 prop是jq的内建属性,处理选中时建议用prop;反返回true,false,页attr返回c原创 2016-10-28 16:22:59 · 330 阅读 · 0 评论 -
select2组件在layer,bootstrap弹出层中使用需要注意z-index问题
dropdownParent: $("#selectCompany-box"), //指定其父元素可避免z-index小于layer 例: $('#selectCompany').select2({ placeholder: { id: -1, text: '输入公司名称', }, allowClear: true, minimumInputLength: 2, ...原创 2018-11-28 15:01:52 · 3774 阅读 · 1 评论 -
jquery封装成promise请求
用promise进行封装 const jqPromiseAjax = (params) => { return new Promise((resolve,reject) => { $.ajax({ url: params.url, type: params.type || 'get', dataType: 'json', headers: params.h...原创 2019-09-05 15:35:59 · 1261 阅读 · 0 评论
分享