Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below


Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest! Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorxyvermax
    • CommentTimeSep 8th 2010
     permalink
    Hey asdf what is the correct way of using z-index on inline style i tried this  
     
    document.getElementById('elementname').style.z-index = 1 but this one did not work.  
     
    Can you give me the right syntax. thanks in advance.
    •  
      CommentAuthorasdf
    • CommentTimeSep 8th 2010 edited
     permalink
    There is a different way to deal with css in JavaScript  
    document.getElementById('elementname').style.zIndex  
     
    all dashes (-) are removed and the camel case is used like other javascript code  
     
    Examples:  
     
    background-color = backgroundColor  
    font-weight = fontWeight  
     
    In JavaScript dashes (-) cannot be used in variable names but underscores (_) can be used.