Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

请教 html data属性的值是如何生成的??

图片描述

jquery代码:

$('a.content_expand').unbind('click').bind('click', function(){
     var link = $(this);
     var data = link.attr('data');
     $('#cell_' + data + ' div.post_excerpt').height('100%');
     link.hide();
      link.next().show();
});
$('a.content_fold').unbind('click').bind('click', function(){
   var link = $(this);
   var data = link.attr('data');
   $('#cell_' + data + ' div.post_excerpt').height('241px');
   link.hide();
   link.prev().show();
   $('html,body').animate({scrollTop: $('#cell_' + data + div.post_excerpt').offset().top-80},'10');
});

求教上图红框中的data属性中的值是如何生成的,谢谢~~!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

这不是前端自动生成的吧,看着像是后台模版填充的,至于后台的生成方式,就不好说了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...