The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

problem with jQuery online / offline

View previous topic View next topic Go down

Solved problem with jQuery online / offline

Post by Guest on 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 ?

Guest
Guest


Back to top Go down

Solved Re: problem with jQuery online / offline

Post by LGforum on 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
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Solved Re: problem with jQuery online / offline

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

thank you !
T/C

Guest
Guest


Back to top Go down

Solved Re: problem with jQuery online / offline

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

Topic Solved & Locked

Sanket
ForumGuru

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

http://webartzforum.com

Back to top Go down

View previous topic View next topic Back to top


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