Need help with minor javascript problem

Discussion in 'JavaScript' started by Eminem, Oct 21, 2008.

  1. #1
    Hey all iv got this iframe on my javascript code, i wont paste it all since its an affiliate code, the colour part of the code is as follows:

    bg=%23ffffff

    However I don't want the colour of the background to be white, i want to include a background image! So can someone please tell me what code to insert to get this to happen.

    Thanks
     
    Eminem, Oct 21, 2008 IP
  2. BrandonGregory

    BrandonGregory Peon

    Messages:
    28
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I would use JS to set the CSS styles. Here's the gist of it:

    object.style.backgroundImage = "images/whatever.jpg";

    I'm not 100% sure that will work, but I think it will. Google "JavaScript style object" to figure out how to set any CSS style using JS.
     
    BrandonGregory, Oct 21, 2008 IP
  3. rhoula

    rhoula Well-Known Member

    Messages:
    875
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    145
    #3
    Please send the script and I will do my best to help you.
    Thank you
     
    rhoula, Oct 21, 2008 IP
  4. xlcho

    xlcho Guest

    Messages:
    532
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you use CSS you should add the image as fallows:
    background: url('path_to_image/image_name.extension');
    Code (markup):
    you can also add repeation of the background, positioning, etc..

    If you need to use JS, you can use BrandonGregory's code
     
    xlcho, Oct 21, 2008 IP