www.webdeveloper.com
Results 1 to 6 of 6

Thread: style.backgroundImage problem..

  1. #1
    Join Date
    Mar 2010
    Posts
    9

    style.backgroundImage problem..

    Hi

    On my site: http://itjobsforyou.eu I want to have multiple header pictures, depending on which menu is selected. I'm trying to do this with javascript, on page load calling
    PHP Code:
    document.getElementById("header").style.backgroundImage url (blablabla) ... 
    But i'm navigating on the site and clicking around, before changing to the header I want, it looks like he sometimes jumps back to the original header ( set with css ). ( You can try it on the site )

    Someone knows a way to solve this?

    Thanks ,

    Niels

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    That JavaScript statement does not appear to be on the site
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Mar 2010
    Posts
    9
    sorry wrong site :

    http://ictjobsforyou.eu :-)

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Not there either
    At least 98% of internet users' DNA is identical to that of chimpanzees

  5. #5
    Join Date
    Mar 2010
    Posts
    9
    It is, you have to click in the menu, job zoeken & contact are other headers, the switch is done with document.getElementById.style.backgroundImage... in a separate js file.

  6. #6
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    This?
    Code:
    k.firstChild.style.backgroundImage="url("+d+")"
    Try giving each page body tag an id then in the css
    Code:
    #home #header{
    background-image:url('img/topbanner_home.png');
    }
    #zoeken #header{
    background-image:url('img/topbanner_zoeken.png');
    }
    Last edited by Fang; 11-05-2010 at 02:25 AM.
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles