发表于: 2016-08-12 00:25:23

0 2430


今天完成的事:学习angular

明天要做的事:重新理一遍之前任务5中的难点

收货:

jQuery.each()的使用方法

$('a').each(function (index, value){
  console.log($(this).attr('href'));
});
$('a').each(function (index, value){
  var link = $(this).attr('href');
 
  if (link.indexOf('http://') === 0) {
        console.log(link);
  }
});
var json = [ 
 { 'red': '#f00' },
 { 'green': '#0f0' },
 { 'blue': '#00f' }
];
 
$.each(json, function () {  $.each(this, function (name, value) {      console.log(name + '=' + value);
  });
});
$('#5demo').bind('click', function (e) {  $('li').each(function (index) {$(this).css('background-color', 'orange')
  .delay(index * 200)
  .fadeOut(1500);
  });
  e.preventDefault();
});



返回列表 返回列表
评论

    分享到