Hello Community,
I have the next newbie question here. This time I tried to write a simple function which returns the position of my coloredbox, by means of the jquery method offset(). Here are my proceedings:
First of all I've written a simple method in my .js:
this.positionleft = function() {
return this.$().offset().left;
};
than, an entry in my .xml
<property type="int" title="PositionLeft" id="positionleft"></property>
and finally my .ztl in order to have this method in my ScriptEditor:
int getPositionLeft()
{*
return this.positionleft;
*}
In Design Studio I entered into the ScriptEditor (onclick) the following statement to show the left position:
COLORBOX_1.getPositionLeft(); //to show it in a textbox
That's it! My result is always 0. I tried to replace this.$().offset().left by 25 (just for testing), and the result was again 0.
I did something wrong.. But what? The goal of this task is to understand how method writing in SDK works. I've read the whole developers guide, but unfortunately without to understand it. I would appreciate to have some tips about literature, blog entries, etc. concerning SDK.
Many thanks.
Emil.