手记

2016-9-7jq多条件筛选

$(document).ready(function(){

          $('.jsSelectCon dd').click(function(){
            var _id = $(this).parents('dl').index();
            if( $(this).parents('dl').hasClass('selected') ){
              $('.jsSelectTit .selected').find('a[name='+_id+']').remove();
            }else{
              $(this).parents('dl').addClass('selected').next('dl').show();
            }

            $(this).find('a').attr('name',_id);
            var _html = $(this).html();
            $('.jsSelectTit .selected').append(_html);

          });
          $('.jsSelectTit .selected a').live('click',function(){
            var _id = $(this).attr('name')*1;
            $('.jsSelectCon dl').eq(_id).removeClass('selected');
            $(this).remove();
            console.log(123);
            return false;
          })

      });
1人推荐
随时随地看视频
慕课网APP