Titanium: click on element(View, Label e.t.c.) should increase its top by 1 -
i've binded same function elements want(let's view , label). in onclick handler function want element clicked , increment 'top' 1.
please tell me if know how that, can't find reply yet.
my global click handler function:
function increaseelementtop(e) { // here should increment element's top position. ti.api.info(json.stringify(e)); }
thanks, help appreciated.
get e.source attribute event e. utilize settop() method.
if (e.source == $.yourlabel) { $.yourlabel.settop($.yourlabel.gettop() + 1) }
update: regarding comment: thought used 2 elements. universal approach this:
e.source.settop(e.source.gettop() + 1);
unfortunately have no machine available test code later (tuesday guess). seek , allow programm print e.source
variable. if not work can seek utilize e.source.getid()
.
titanium titanium-alloy
No comments:
Post a Comment