随笔分类 - JQuery
摘要:1、针对input、textarea 2、针对div(contenteditable="true")
阅读全文
摘要:下面的这个代码是网络上的代码,做一个分析记录,原网址如下 http://www.jq22.com/jquery-info3836 html: css: js:
阅读全文
摘要://选择与取消选择 $('input').prop('checked',true); $('input').prop('checked',false); //判断是否选中,在做反选的操作 if($(this).prev('.spaninput').children('input').is(":che
阅读全文
摘要:
阅读全文
摘要:var mySwiper = new Swiper('.swiper-container',{ slidesPerView :'auto', autoplay:5000, direction:'vertical', grabCursor:true, autoplayDisableOnInteraction:false, mousewheelContro...
阅读全文
摘要:$(document).ready(function(){ var $liCur = $(".nav ul li.cur"), curP = $liCur.position().left, curW = $liCur.outerWidth(true), $slider = $(".curBg"), $navBox = $("....
阅读全文
摘要:// 随滚动条浮动 $('.Step_points').width($('.Leftbox').width()); var Step_points_top=$('.Step_points').offset().top; $(window).scroll(function(){ console.log($(window).scrollTop()); ...
阅读全文
摘要:<!--IE8只能支持jQuery1.9--><!--[if lte IE 8]><script src="http://cdn.bootcss.com/jquery/1.9.0/jquery.min.js"></script><![endif]-->
阅读全文
摘要:$(window).scroll(function(){ var before = $(window).scrollTop(); $(window).scroll(function() { var after = $(window).scrollTop(); if (before<after) {
阅读全文
摘要:jquery遍历js数组需要先将js数组对象包装成jquery对象,然后调用jquery的each函数遍历。或者直接调用$.each函数也可以遍历数组。遍历函数中使用this取得当前遍历的项。遍历函数可以带参数,一个参数的话就是数组下标。代码如下。
阅读全文
摘要:$('.page-normal a:not(:first, :last)')
阅读全文
摘要:var num = 8;for (var i = 0; i < num; i++) { $('ul').append('<li></li>');};
阅读全文
摘要:$(selector).index(element) 0 1 2 3 4 $('.indextest div').click(function(event) { /* Act on the event */ console.log($(this).index('.index...
阅读全文
摘要:expression (String) : 用来查找的字符串 context (Element, jQuery) : (可选) 作为待查找的 DOM 元素集、文档或 jQuery 对象。 例: $('#member_id',window.opener.document).attr('value','
阅读全文

浙公网安备 33010602011771号