locked
Dynamically set style properties on html elements RRS feed

  • Question

  • Hi all,

    I'm loading several div elements from Js. But the problem is i need to leave specific left margin(margin-left) for each one of those elements.

    exactly something like this in Js.

    <div class=\"wideHighItem\" style=\"margin-"+MyValue+"\"\">

    but this method is not possible in WinJs. Is there any way to do this stuff.

    Help me


    Wednesday, July 24, 2013 10:52 AM

All replies

  • This should be possible using standard JS methods, you can access the style object of each dom element and set the properties you want.
    Wednesday, July 24, 2013 1:14 PM
  • I tried but it doesn't work. Errors return in winJS library 
    Thursday, August 1, 2013 4:04 AM
  • Would you care to share the errors? It is difficult to help without details.
    Thursday, August 1, 2013 2:04 PM