How can I apply color to the line element upto specified offsetwidth using css style?

Smey

New Member
want to apply specified color to the Line element upto specified widht?Wherever I click on the line I am getting the offsetWidth of it, so I have to apply different color upto that offsetwidht, How can I do this, any idea?\[code\]int lineWidth = DOM.getElementPropertyInt(lineElement, "offsetWidth");int lineLeftOffset = (width / 2) - (lineWidth / 2);DOM.setStyleAttribute(lineElement, "left", lineLeftOffset + "px");\[/code\]Here using lineLeftOffset I am setting current position, And till the current position I have to give different color to the lineElement. I tried following but it is applying color to whole element.\[code\] DOM.setStyleAttribute(lineElement, "backgroundColor", "red");\[/code\]
 
Back
Top