随笔分类 -  JQuery

摘要:1、针对input、textarea 2、针对div(contenteditable="true") 阅读全文
posted @ 2018-03-19 17:04 ghfjj 阅读(1404) 评论(0) 推荐(0)
摘要:下面的这个代码是网络上的代码,做一个分析记录,原网址如下 http://www.jq22.com/jquery-info3836 html: css: js: 阅读全文
posted @ 2017-12-21 12:00 ghfjj 阅读(872) 评论(0) 推荐(0)
摘要://选择与取消选择 $('input').prop('checked',true); $('input').prop('checked',false); //判断是否选中,在做反选的操作 if($(this).prev('.spaninput').children('input').is(":che 阅读全文
posted @ 2017-12-21 11:55 ghfjj 阅读(391) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2017-12-18 09:43 ghfjj 阅读(407) 评论(0) 推荐(0)
摘要:var mySwiper = new Swiper('.swiper-container',{ slidesPerView :'auto', autoplay:5000, direction:'vertical', grabCursor:true, autoplayDisableOnInteraction:false, mousewheelContro... 阅读全文
posted @ 2017-12-08 09:40 ghfjj 阅读(15826) 评论(0) 推荐(1)
摘要:$(document).ready(function(){ var $liCur = $(".nav ul li.cur"), curP = $liCur.position().left, curW = $liCur.outerWidth(true), $slider = $(".curBg"), $navBox = $(".... 阅读全文
posted @ 2017-12-05 16:20 ghfjj 阅读(908) 评论(0) 推荐(0)
摘要:// 随滚动条浮动 $('.Step_points').width($('.Leftbox').width()); var Step_points_top=$('.Step_points').offset().top; $(window).scroll(function(){ console.log($(window).scrollTop()); ... 阅读全文
posted @ 2017-11-29 14:28 ghfjj 阅读(423) 评论(0) 推荐(0)
摘要:<!--IE8只能支持jQuery1.9--><!--[if lte IE 8]><script src="http://cdn.bootcss.com/jquery/1.9.0/jquery.min.js"></script><![endif]--> 阅读全文
posted @ 2017-11-20 13:19 ghfjj 阅读(252) 评论(0) 推荐(0)
摘要:html css js 阅读全文
posted @ 2017-08-30 16:49 ghfjj 阅读(304) 评论(0) 推荐(0)
摘要:$(window).scroll(function(){ var before = $(window).scrollTop(); $(window).scroll(function() { var after = $(window).scrollTop(); if (before<after) { 阅读全文
posted @ 2017-06-08 11:51 ghfjj 阅读(2256) 评论(0) 推荐(0)
摘要:jquery遍历js数组需要先将js数组对象包装成jquery对象,然后调用jquery的each函数遍历。或者直接调用$.each函数也可以遍历数组。遍历函数中使用this取得当前遍历的项。遍历函数可以带参数,一个参数的话就是数组下标。代码如下。 阅读全文
posted @ 2017-05-16 15:48 ghfjj 阅读(478) 评论(0) 推荐(0)
摘要:$('.page-normal a:not(:first, :last)') 阅读全文
posted @ 2017-05-04 14:39 ghfjj 阅读(174) 评论(0) 推荐(0)
摘要:上下两段代码效果一样!!! 阅读全文
posted @ 2017-04-19 00:32 ghfjj 阅读(1206) 评论(0) 推荐(0)
摘要:var num = 8;for (var i = 0; i < num; i++) { $('ul').append('<li></li>');}; 阅读全文
posted @ 2017-04-07 09:32 ghfjj 阅读(718) 评论(0) 推荐(0)
摘要:$(selector).index(element) 0 1 2 3 4 $('.indextest div').click(function(event) { /* Act on the event */ console.log($(this).index('.index... 阅读全文
posted @ 2017-04-01 15:39 ghfjj 阅读(405) 评论(0) 推荐(0)
摘要:expression (String) : 用来查找的字符串 context (Element, jQuery) : (可选) 作为待查找的 DOM 元素集、文档或 jQuery 对象。 例: $('#member_id',window.opener.document).attr('value',' 阅读全文
posted @ 2017-03-31 09:58 ghfjj 阅读(286) 评论(0) 推荐(0)