www.webdeveloper.com
Results 1 to 3 of 3

Thread: Simple. Need help with getAttribute to style BackgroundImage

  1. #1
    Join Date
    Mar 2006
    Location
    Colorado
    Posts
    61

    Simple. Need help with getAttribute to style BackgroundImage

    I've created a page with all of the script and html inline http://207.179.75.89/spartanstatic/sumitomo/slider.html

    Please take a look at and see if you can help me. This is going to be linked to CMS so i need something in the html so that i can tie it in. Possibly a getAttribute by rel tag and then specify the location of the image in the rel tag..? Or if there's a better way any help and advice is appreciated!

  2. #2
    Join Date
    Feb 2006
    Posts
    2,926
    getAttribute won't work for style properties in ie.
    You can set the element.style.backgroundImage='url(quoted url)';
    make sure the url is quoted, and if you can make it an absolute reference you'll have few problems.

  3. #3
    Join Date
    Mar 2006
    Location
    Colorado
    Posts
    61
    Bummer about the IE support.

    Putting the image in quotes doesn't help. I need it to be a variable that i pass in the html rather than a fixed location inside the JS.

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