The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

problem with jQuery online / offline

2 posters

Go down

Solved problem with jQuery online / offline

Post by Guest September 13th 2012, 9:03 am

my code
Code:
$(function() {
$('.postprofile dd:first').after('<dd class="online"><span class="online"><span class="ipson">CONECTAT</span></span></dd>');
$('.postprofile dd:first').after('<dd class="offline"><span class="offline"><span class="ipsoff">DECONECTAT</span></span></dd>');
$('.post:not(".online")').addClass('offline');
});

how can I make it appear only once online when I'm online
and offline when they are disconnected ?
avatar
Guest
Guest


Back to top Go down

Solved Re: problem with jQuery online / offline

Post by LGforum September 13th 2012, 2:47 pm

Well why didn't you just do this:
Code:
$(function() {
  $('.post:not(".online")').addClass('offline');
  $('.online .postprofile dd:first').after('<dd class="online"><span class="online"><span class="ipson">CONECTAT</span></span></dd>');
  $('.offline .postprofile dd:first').after('<dd class="offline"><span class="offline"><span class="ipsoff">DECONECTAT</span></span></dd>');
});
LGforum
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Solved Re: problem with jQuery online / offline

Post by Guest September 13th 2012, 4:58 pm

thank you !
T/C
avatar
Guest
Guest


Back to top Go down

Solved Re: problem with jQuery online / offline

Post by Sanket September 14th 2012, 8:10 pm

Topic Solved & Locked
Sanket
Sanket
ForumGuru

Male Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum