HabboxWiki needs you!
Are you a Habbo buff? Or maybe a rare trader with a bunch of LTDs? Get involved with HabboxWiki to share your knowledge!
Join our team!
Whether you're raving for rares, excited for events or happy helping, there's something for you! Click here to apply
Need a helping hand?
Check out our guides for all things to help you make friends, make rooms, and make money!


Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: CSS Help.

  1. #11
    Join Date
    Mar 2010
    Location
    Cornwall (UK)
    Posts
    2,328
    Tokens
    5,839
    Habbo
    -Nick

    Latest Awards:

    Default

    Quote Originally Posted by xxMATTGxx View Post
    That would be telling
    Well please will you tell us matt! With a cherry on top!

  2. #12
    Join Date
    Dec 2004
    Location
    England
    Posts
    1,916
    Tokens
    7,717
    Habbo
    maken

    Latest Awards:

    Default

    Also, codeacademy.com is fantastic.



  3. #13
    Join Date
    May 2005
    Location
    /etc/passwd
    Posts
    19,110
    Tokens
    1,139

    Latest Awards:

    Default

    Habbox uses JS for our VIP colours.
    Quote Originally Posted by Chippiewill View Post
    e-rebel forum moderator
    :8

  4. #14
    Join Date
    Oct 2011
    Location
    Melbourne
    Posts
    637
    Tokens
    1,376

    Default

    Take a squizz at their source code and you'll see how Habbox does it.

    PHP Code:
    //redandgreenfunction alternatingColours(selector, rainbowcolours)
    {
     var 
    currentcolor 0;
     var 
    amountinarray rainbowcolours.length;
     $(
    selector).each(function(){
      var 
    letters = $(this).html().split('');
      $(
    this).html('');
      for(var 
    i in letters)
      {
       if(
    letters[i] != ' ')
       {
        if(
    letters[i].toString().search('unction') == -1)
         $(
    this).append('<span style="font-weight: bold; text-decoration: none; color: #' rainbowcolours[currentcolor] + ';">' letters[i] + '</span>');
         
        
    currentcolor++;
        if(
    currentcolor == amountinarraycurrentcolor 0;
       }else{
        $(
    this).append(' ');
       }
      }
     });
      } 
    and to get their colours
    PHP Code:
    $(document).ready(function(){
        
    alternatingColours('.redandgreen',Array('CB150B','3C8D0D'));//redandgreen}); 
    and then they set the class of the span they want to change colours to that name (redandgreen)

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •