Loading ...
Sorry, an error occurred while loading the content.
 

javascript help

Expand Messages
  • 2o Grupo da AEP
    Hello! I want do read messages from a .txt file and show them in my page, like a news boletim. JMadeira
    Message 1 of 4 , Sep 6, 2003
      Hello!

      I want do read messages from a .txt file and show them in my page,
      like a news boletim.

      JMadeira
    • Mike Jablonski
      I was wondering if anyone knew how to customize a table s cell and border colors (lets say 6x3)using javascript. I would like to use pop up color palette
      Message 2 of 4 , May 27, 2006
        I was wondering if anyone knew how to customize a table's cell and
        border colors (lets say 6x3)using javascript. I would like to use pop
        up color palette window. Then as soon as I choose the color, the
        table new features would take effect. Any advice on this would be
        appreciated. I don't even know if this is possible. Thanks
      • Nick Jones
        ... From: Mike Jablonski To: JavaScript_Official@yahoogroups.com Sent: Saturday, May 27, 2006 11:57:19 AM Subject: [JavaScript] javascript
        Message 3 of 4 , May 28, 2006
          ----- Original Message ----
          From: Mike Jablonski <lehula@...>
          To: JavaScript_Official@yahoogroups.com
          Sent: Saturday, May 27, 2006 11:57:19 AM
          Subject: [JavaScript] javascript help

          I was wondering if anyone knew how to customize a table's cell and
          border colors (lets say 6x3)using _javascript. I would like to use pop
          up color palette window. Then as soon as I choose the color, the
          table new features would take effect. Any advice on this would be
          appreciated. I don't even know if this is possible. Thanks


          [reply]
          Easy

          document.getElementById('cell_id').style.background-color = "#ff0000" //or whatever color you want
          document.getElementById('cell_id').style.border-color = "#00ff00" //again, any color you prefer

          HTH
          -Nick
          [/reply]





          [Non-text portions of this message have been removed]
        • Jon Stephens
          (Please use a subject that reflects the content of the email, thanks.) ... The mechanics of changing the colours aren t that difficult. Say your table has the
          Message 4 of 4 , May 28, 2006
            (Please use a subject that reflects the content of the email, thanks.)

            > From: "Mike Jablonski" lehula@...
            > Date: Sun May 28, 2006 1:47am(PDT)
            > Subject: javascript help
            >
            > I was wondering if anyone knew how to customize a table's cell and
            > border colors (lets say 6x3)using javascript. I would like to use pop
            > up color palette window. Then as soon as I choose the color, the
            > table new features would take effect. Any advice on this would be
            > appreciated. I don't even know if this is possible. Thanks
            >

            The mechanics of changing the colours aren't that difficult. Say your
            table has the id "custom". Then you could write a function like this one:

            function customiseTableColours(bc, bg)
            {
            // Get a reference to the table
            var myTable = document.getElementById("custom");

            // Set the border colour
            myTable.style.borderColor = bc;
            // Set the background colour
            myTable.style.backgroundColor = bg;
            }

            Call the function like this:

            customiseTableColours("#369", "#FC0");

            Determining exactly how and when such a function would be called depends
            on how you want it to work. I'm assuming here that yuou mean that you're
            going to offer the user a list of colour combinations. If you're going
            to allow the user to select the border and background colours
            separately, then you'd need to perform those two actions separately

            I wouldn't use a popup window, though - too many people get cranky about
            those and even have popup-killers these days. Might be better to wrap
            the palette in a div tag, and show/hide it by setting its style.display
            property to "block"/"none".

            --
            This message has not been scanned for viruses.

            Since I do not use a Microsoft operating
            system or software, and use only plaintext
            for email, there is little need for me to do so.
          Your message has been successfully submitted and would be delivered to recipients shortly.