0
페이지에 일부 섹션이 있고 코드에서 상속 된 특정 섹션에 클릭 이벤트를 추가하기 위해 필터를 사용합니다. 섹션을 클릭하면 설명 상자가 표시됩니다.Jquery 필터 문제 - 상위 필터링 및 하위 이벤트 추가
$('section[data-actionid]').filter(function() {
var tpe = parseInt($(this).attr('data-actiontypeid'), 10);
//allow inner if not a like and not a wallpostcomment, i.e. end of the line
return (tpe % 100 !== Tm.action.Comment &&(tpe < 10000 || tpe > 20000));
}).on('click', function() {
var actionid = $(this).data('actionid');
var lic = $(this).find('li[data-actionid]:not([data-parentid])');
if (!lic || lic.length == 0) {
return;
}
var li = lic[0];
if (actionid) {
GetTMActionInner(li, actionid, objid, vwrsid, successGetTMActionInnerCallback, failureGetTMActionInnerCallback);
}
});
은 이상적으로는 클래스 TMComment으로, 특정 링크의 클릭에이 작업을 수행 할 수 있지만, 두 가지를 결합하는 방법을 확실입니다.
해당 클래스의 anchor tag
에 필터를 추가 한 다음 부모 섹션에서 필터링해야하는 데이터를 얻거나 더 쉬운 방법이 있습니까?