//菜单根据url变颜色$(document).ready(function(){ $('#nav li a').each(function(){ if($($(this))[0].href==String(window.location)) $(this).parent().addClass('o ...
分类:
Web程序 时间:
2016-08-09 18:46:53
阅读次数:
247
// 获得设定内容 [text(),html(),val()]; // 获得设定属性 [attr(),removeAttr()]; // 获得设定 css class [addClass,removeClass,hasClass,toggleClass]; ...
分类:
Web程序 时间:
2016-08-08 00:54:57
阅读次数:
164
$(function(){ $("#userCenterProject").addClass("cur"); $(".hd ul li").click(function(){ var index=$(this).index(); $(this).addClass("on").siblings().r ...
分类:
Web程序 时间:
2016-08-03 20:04:04
阅读次数:
151
addClass()-为每个匹配的元素添加指定的样式类名after()-在匹配元素集合中的每个元素后面插入参数所指定的内容,作为其兄弟节点append()-在每个匹配元素里面的末尾处插入参数内容attr() - 获取匹配的元素集合中的第一个元素的属性的值bind() - 为一个元素绑定一个事件处理程 ...
分类:
其他好文 时间:
2016-07-30 00:21:45
阅读次数:
508
$(".tab-title li").on('click', function(){ $(".tab-title li").eq($(this).index()).addClass("cur").siblings().removeClass('cur'); $(".tab-con>div").hid ...
分类:
其他好文 时间:
2016-07-20 11:46:06
阅读次数:
103
$("#all").change(function() { if ($(this).is(":checked")) { $(".checkTd").each(function () { $(this).find("span").addClass("checked"); }); } else { $( ...
分类:
其他好文 时间:
2016-07-13 01:07:52
阅读次数:
142
示例: 1、隔行变色:CSS代码:.even{background:red};.odd{background:green};然后分别给奇偶行添加样式如下:$(function(){ $("tr:even").addClass(even); $("tr:odd").addClass(odd);});上 ...
分类:
Web程序 时间:
2016-07-12 21:10:23
阅读次数:
233
angular.element(el).find("input").attr({value:1}); * ## Angular's jqLite * jqLite provides only the following jQuery methods: * * - [`addClass()`](htt... ...
分类:
Web程序 时间:
2016-07-06 01:47:57
阅读次数:
248
今天在翻阅JQuery API的时候发现,addClass()方法不仅可以添加类,同时可以调用回调函数。 代码如下: 在addClass()中的调用匿名函数,参数为当前元素的索引,然后返回类名。 效果如下: 当然,这个回调函数可以设置两个参数,第一个为index,第二个为类名参数,主要用于控制语句。 ...
分类:
其他好文 时间:
2016-07-04 11:28:23
阅读次数:
287