首页 > 其他 > 详细

20150302随笔

时间:2015-03-02 18:29:00      阅读:181      评论:0      收藏:0      [点我收藏+]

1.对象的查找

document.title = obj[self.today.substring(0, 7)];

不需要以下这么麻烦:

$.each(obj , function(index,val){
    var month = self.today.substring(0,7);
    if(index == month){
    document.title = val;
    }
});

 

2.each

如果是遍历节点时:

self.pages.each(function(index){

  $(this).css(‘z-index‘, self.pageLen+1);

})

如果遍历数组时:

$([1,2,11]).each(function(i,item){

  console.log(item)

})

 

20150302随笔

原文:http://www.cnblogs.com/vivijs/p/4309017.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!