how do i access background-image?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mpayne@qualtech-int.com.au

    #1

    how do i access background-image?

    I tried obj.style.backg round-image, and got the error "'image' is
    undefined".

    Thanks
    Martin

  • David Dorward

    #2
    Re: how do i access background-image?

    mpayne@qualtech-int.com.au wrote:
    [color=blue]
    > I tried obj.style.backg round-image, and got the error "'image' is
    > undefined".[/color]

    ..backgroundIma ge

    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    • RobG

      #3
      Re: how do i access background-image?

      mpa...@qualtech-int.com.au wrote:[color=blue]
      > I tried obj.style.backg round-image, and got the error "'image' is
      > undefined".
      >[/color]

      Try:

      obj.style.backg roundImage


      hyphens are not allowed in JavaScript identifiers. As a general rule
      when dealing with style attributes, drop the hyphen and capitalise the
      first character of the next word.

      --
      Rob

      Comment

      • Jimnbigd

        #4
        Re: how do i access background-image?

        Syntax is: obj.style.backg roundImage
        No dash -- uppercase I.
        The dash was interpretted as a minus sign -- Subtract the variable
        "image" -- and you get "image" is undefined.
        ....Jim Lee, Dallas, TX...

        <mpayne@qualtec h-int.com.au> wrote in message
        news:1115620847 .035095.312680@ g14g2000cwa.goo glegroups.com.. .[color=blue]
        > I tried obj.style.backg round-image, and got the error "'image' is
        > undefined".
        >
        > Thanks
        > Martin
        >[/color]


        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: how do i access background-image?

          RobG wrote:
          [color=blue]
          > Try:
          >
          > obj.style.backg roundImage
          >
          >
          > hyphens are not allowed in JavaScript identifiers. [...][/color]

          That is not entirely true. The hyphen is in fact a minus which acts as
          an operator in JS, and operator whitespace is optional. That is why it
          cannot be part of an identifier.


          PointedEars
          --
          *************** *************** *************** ***************
          * NEW: psf suited for <http://tagzilla.mozdev .org/>! *
          * <http://pointedears.de/psf/> *
          *************** *************** *************** ***************

          Comment

          Working...