KickApps: Adding classes to the leave / join button on the groups page.


/ Published in: JavaScript
Save to your folder(s)

Sometime, you need unique classes on the leave join button of the groups page. Place this script in your AC footer.

--
For more tips and tricks checkout the <a href="http://www.kickdeveloper.com/resources">KickApps resources page</a>.


Copy this code and paste it in your HTML
  1. var oldStallLeaveJoin = stallLeaveJoin;
  2. newStallLeaveJoing = function() {
  3. var isMember = $j('#ka_joinButton > input').attr('value') ==
  4. "leave this group";
  5. if (isMember) {
  6. $j('#ka_joinButton >
  7. input').addClass('ka_isMember').removeClass('ka_isNotMember');
  8. } else {
  9. $j('#ka_joinButton >
  10. input').addClass('ka_isNotMember').removeClass('ka_isMember');
  11. }
  12. };
  13. stallLeaveJoin = function() {
  14. newStallLeaveJoing();
  15. oldStallLeaveJoin();
  16. };
  17. // uncomment the below line only if needed
  18. // newStallLeaveJoing();

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.