Script edit so my flash logo will work.

Discussion in 'Programming' started by joesgraphics, Jan 10, 2007.

  1. #1
    Hi i have made a flash logo for my site the old logo is a image this is how it is shown in the layout

    <script>
    if (document.getElementById("logo-div").style.backgroundImage.indexOf("images/null.gif") > 0){
    document.getElementById("logo-div").style.backgroundImage = "url(this is were the logo was and i want the flash bit to go)";
    }
    </script>

    How will i make that so it shows my flash file not a normal image file if it can be done.

    Thanks in Advanced.

    If i put the in the rong part of the forum please move to the right part thanks.
     
    joesgraphics, Jan 10, 2007 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    I'm not sure that the property style.backgroundImage in JavaScript can detect a CSS Set background image. Instead, i would just set a div to have a background image and when Flash can load - it will display the flash element inside the div ontop of the background image so it couldn't be seen. Remeber the IE Ebola bug so use FlashObject (Now called SWFObject) to include the flash element :)
     
    ccoonen, Jan 12, 2007 IP
  3. joesgraphics

    joesgraphics Peon

    Messages:
    206
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ok thanks ill try that when i have time. :)
     
    joesgraphics, Jan 13, 2007 IP
  4. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #4
    Flash doesn't work as a background

    You will need to insert the flash as a flash object, the only possible way to display flash to client browser is as an object.

    Peace,
     
    Barti1987, Jan 13, 2007 IP
  5. joesgraphics

    joesgraphics Peon

    Messages:
    206
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    yh but how will i get it in the same palce as the old logo should i put it in the logo div tags.
     
    joesgraphics, Jan 13, 2007 IP
  6. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #6
    yes, put the logo in the div tags, it will be replaced by the JS Embed
     
    ccoonen, Jan 16, 2007 IP
  7. joesgraphics

    joesgraphics Peon

    Messages:
    206
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Ok thanks. :)
     
    joesgraphics, Jan 16, 2007 IP