each方法应用(列表-json数据展示)

来源:互联网 发布:清华外语软件下载 编辑:程序博客网 时间:2024/06/10 21:37

1、通过each方法,鼠标滑过列表每一项时,样式改变:

$('#GrowthProcess').find('.pro-time').each(function(i,sender){    $(sender).hover(function(){         $(this).addClass('ac-time');         $(this).css({'fontSize':'16px'});     },function(){        $(this).removeClass('ac-time');        $(this).css('fontSize','14px');         $(this).find('p').css({'position':'static','top':'0'});        if(i == 0){ $(this).addClass('ac-time');}    });});

2、json数据展示(待续)

0 0