How to change design only for specific activities
-
I think that I want to change only activities about like “Smith and Jon are now friends” to
background: pink;
But in the following code error that “targetTxt is undefined”.
(function($){ var url = location.href var urlSplit_activity = url.split('/')[5]; if (urlSplit_activity == 'activity'){ var observer = new MutationObserver(function (MutationRecords, MutationObserver) { $('.activity-header a:nth-child(2)').each(function() { var targetTxt = this.nextSibling.data; //error if (targetTxt.indexOf('are now friends') >= 0) { $(this).closest('li').css('background','pink'); } }); }); observer.observe($('#activity-stream').get(0), { childList: true, attributes: true, subtree: true }); } })(jQuery);
Would you mind teaching me how to do that?
Thanks.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.