Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function activeuser(userId) {
- $.post("/admin/activate_user", {
- userid: userId
- }, function (response) {
- });
- }
- <span id="enable<?=$user->id; ?>" class="cb-enable <?=$active_class;?>" onclick="return activeuser(<?= $user->id ?>);"><span>Active</span></span>
- <span id="disenable<?=$user->id; ?>" class="cb-disable <?=$deactive_class;?>" onclick="return deactiveuser(<?= $user->id ?>);"><span>De-active</span></span>
- if($('#thatSpan').hasClass('cb-enable') && $('#thatSpan').hasClass('selected'))
- {
- //your code goes here.
- }
- if($('#thatSpan').is('.cb-enable.selected'))
- {
- //your code goes here.
- }
- function activeuser(userId){
- if(! ($(this).hasClass('cb-enable') && $(this).hasClass('selected')) ){
- $.post("/admin/activate_user",
- {
- userid: userId
- },
- function(response){
- if(response == "active"){
- $('#enable'+userId).addClass('selected');
- $('#disenable'+userId).removeClass('selected');
- $('#disenable'+userId).addClass('pointer');
- $('#enable'+userId).removeClass('pointer');
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement