Hi, I'm newbie. Nice to meet all of you. I'd like to **updating element 's
style by event handler** set by Karax. So I wrote like this, but it doesn't
work. (With click, text changes but style doesn't update. )
var mystyle = newJSeq[cstring]()
mystyle.add cstring"transform"
mystyle.add cstring"translateX(0px)"
var t: string = "For many years, computer programmers have been"
proc mainHtml(): VNode =
result = buildHtml(main(id="main", class="main", style = mystyle )):
text t
proc onclick(ev: Event, n: VNode) =
t = "callback is triggered well...."
mystyle.setAttr(transform, "translateX(150px")
proc main(): VNode =
return buildHtml(tdiv):mainHtml()
setRenderer main
Run
May be the code around `setAttr` is wrong, so I read Vstyles.nim but couldnt
make my understand where is wrong. Anybody could help?