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,329
    Tokens
    6,755
    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
    8,419
    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
  •