(Alternation) How to do this?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    (Alternation) How to do this?

    How to this thing an alternate color in posting?

    For example: in chat room or in forum topics.

    -----------
    This post have black background
    -----------
    This post have white background
    -----------
    This post have black background
    -----------
    This post have white background
    -----------

    How to do that? Does anyone can help me out? When my members post a message in chat they all have same bg, i just want it alternate.

    #2
    Put this into your css
    Code:
    div.whitebg{
    background-color:#FFFFFF;
    color:#000000;
    }
    div.blackbg{
    background-color:#000000;
    color:#FFFFFF;
    }
    Usage:
    Code:
    -----------
    <div class="blackbg">This post have black background</div>
    -----------
    <div class="whitebg">This post have white background</div>
    -----------
    <div class="blackbg">This post have black background</div>
    -----------
    <div class="whitebg">This post have white background</div>
    -----------
    Did I help you?
    You can help me too
    Your donations will help me finance my studies.

    Comment


      #3
      But in chat or shoutbox even in autoindex you cant do it like that when s0mebody post or reply a message.Anyway thanx 4 your reply.

      Does anyone have a way?

      Comment


        #4
        i think you need this
        <?php
        // wap-landz.tk
        for($i=0;$i<5;$i++) {
        $post_bg = ($bg++%2 == 0) ? "black" : "white";
        echo "<div style='background-color: $post_bg'>TexT</div>";
        }
        ?>

        Comment


          #5
          Originally posted by kei_ki7 View Post
          Put this into your css
          Code:
          div.whitebg{
          background-color:#FFFFFF;
          color:#000000;
          }
          div.blackbg{
          background-color:#000000;
          color:#FFFFFF;
          }
          Usage:
          Code:
          -----------
          <div class="blackbg">This post have black background</div>
          -----------
          <div class="whitebg">This post have white background</div>
          -----------
          <div class="blackbg">This post have black background</div>
          -----------
          <div class="whitebg">This post have white background</div>
          -----------
          this one will work.. :D

          http://wapx.amob.com
          Applications, Games, Wallpapers, Ringtones, Videos, Themes, Screensaver and More!!!

          Comment


            #6
            that will work in html he needed in php @wapxtech

            Comment


              #7
              Originally posted by ionutvmi View Post
              that will work in html he needed in php @wapxtech
              html can be use in php.. lol
              Code:
              <?
              echo "<div class='divname'>body</div>";
              ?>
              simple as that, learn PHP

              http://wapx.amob.com
              Applications, Games, Wallpapers, Ringtones, Videos, Themes, Screensaver and More!!!

              Comment


                #8
                @wapxtech i appreciate ur input but try to use it in chat it wont work for an alternate color

                ionutvmi script is w0rking fine

                this is what im trying to say

                No Alternation
                With alternation

                That's it anyway thanx

                Comment


                  #9
                  Originally posted by Jervy View Post
                  @wapxtech i appreciate ur input but try to use it in chat it wont work for an alternate color

                  ionutvmi script is w0rking fine

                  this is what im trying to say

                  No Alternation
                  With alternation

                  That's it anyway thanx
                  its because you dont include your .css file..

                  Code:
                  <?
                    echo "<link rel='stylesheet' type='text/css' href='your_css_file.css'>";
                  ?>

                  http://wapx.amob.com
                  Applications, Games, Wallpapers, Ringtones, Videos, Themes, Screensaver and More!!!

                  Comment


                    #10
                    I already included my .css file the same way you posted it.

                    Take a look at this bro..

                    echo '<div class'black'>$autopostmessage</div>';

                    it work like this..

                    -------------------
                    autopostmessage with black bg
                    -------------------

                    and when someone post an autopostmessage again it will display like this...

                    -------------------
                    autopostmessage with black bg
                    -------------------
                    autopostmessage with black bg
                    -------------------


                    and so on...

                    No alternate color

                    Comment


                      #11
                      Originally posted by Jervy View Post
                      I already included my .css file the same way you posted it.

                      Take a look at this bro..

                      echo '<div class'black'>$autopostmessage</div>';

                      it work like this..

                      -------------------
                      autopostmessage with black bg
                      -------------------

                      and when someone post an autopostmessage again it will display like this...

                      -------------------
                      autopostmessage with black bg
                      -------------------
                      autopostmessage with black bg
                      -------------------


                      and so on...

                      No alternate color
                      wrong html tag.. it must be

                      Code:
                      echo "<div class='black'>$autopostmessage</div>";
                      or

                      Code:
                      echo "<div class=\"black\"/>$autopostmessage</div>";

                      http://wapx.amob.com
                      Applications, Games, Wallpapers, Ringtones, Videos, Themes, Screensaver and More!!!

                      Comment


                        #12
                        I just f0rgot to write "=" sign.But it function the same way right

                        Comment


                          #13
                          Originally posted by Jervy View Post
                          I just f0rgot to write "=" sign.But it function the same way right
                          yah.. it must work in that way..

                          http://wapx.amob.com
                          Applications, Games, Wallpapers, Ringtones, Videos, Themes, Screensaver and More!!!

                          Comment


                            #14
                            here is complete tutorial for alternate background color
                            Alternating table row colors
                            sigpic

                            Comment

                            Working...
                            X