problem with jQuery online / offline Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
2 posters

    problem with jQuery online / offline

    avatar
    Guest
    Guest


    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 ?
    LGforum
    LGforum
    Hyperactive


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

    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>');
    });
    avatar
    Guest
    Guest


    Solved Re: problem with jQuery online / offline

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

    thank you !
    T/C
    Sanket
    Sanket
    ForumGuru


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

    Solved Re: problem with jQuery online / offline

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

    Topic Solved & Locked