BackGround picture

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bobyjones
    New Member
    • Jul 2010
    • 13

    BackGround picture

    Hi all I was wondering if there was anyone who could help me with this I have been having fun making random background colors but I would like to start making background pictures.

    can you help me??????!!??!!! ???
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    please show what code you have so far.

    Comment

    • bobyjones
      New Member
      • Jul 2010
      • 13

      #3
      Originally posted by gits
      please show what code you have so far.
      I don't have any code yet....

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        then basically you could set a new url for the backround-image css like this:
        Code:
        obj.style.backgroundImage = 'url(newImage.jpg)';
        i assume you have some logic to get random image urls ... it would be similar as the logic for random bachground-colors ...

        Comment

        • bobyjones
          New Member
          • Jul 2010
          • 13

          #5
          Originally posted by gits
          then basically you could set a new url for the backround-image css like this:
          Code:
          obj.style.backgroundImage = 'url(newImage.jpg)';
          i assume you have some logic to get random image urls ... it would be similar as the logic for random bachground-colors ...
          Oh Okay Easier than I thought thank you.

          Comment

          • bobyjones
            New Member
            • Jul 2010
            • 13

            #6
            Originally posted by gits
            then basically you could set a new url for the backround-image css like this:
            Code:
            obj.style.backgroundImage = 'url(newImage.jpg)';
            i assume you have some logic to get random image urls ... it would be similar as the logic for random bachground-colors ...
            Sorry but where excactly do I put it?

            Comment

            • gits
              Recognized Expert Moderator Expert
              • May 2007
              • 5390

              #7
              you cannot simply put it somewhere ... you would need to use a reference for obj which could be a div or the document's body or whatever element.

              Comment

              • bobyjones
                New Member
                • Jul 2010
                • 13

                #8
                Originally posted by gits
                you cannot simply put it somewhere ... you would need to use a reference for obj which could be a div or the document's body or whatever element.
                Okay thank you

                Comment

                Working...