Oct 26 2007

Elements.getTotalSize(), get the total size of an array of elements

Tag: Javascript, Mootools, Web developmentJens @ 8:12 am

While creating a mootools Slider-controled image gallery navigator (fancy huh?) at work, I suddenly had the need for getting the Total size (width in this case) of all the li elements inside a ul.

Continue reading “Elements.getTotalSize(), get the total size of an array of elements”


Oct 26 2007

Lesson learned, extending mootools with Array/Element properties

Tag: RantJens @ 7:52 am

I’ve twisted my brain in all different angles today, trying to get my first custom Array property in mootools to work.
For some reason my code kept returning the content as an array, and not as an object like I’d set up my piece of code to do.

It turned out that there was allready a property with the name I selected for Elements, which Array then had inherited..
thus, it allready existed, returning an array of objects (the same object I was trying to return, actually..).

I ended up adding the property to Elements instead (for another reason), with a new Property name.

Lesson: before you try to add a new property to Array, Elements, or any Class in general, check if it allready exists :p





Warning: stristr() [function.stristr]: Empty delimiter in /home/asocialp/public_html/wp-content/plugins/wassup/wassup.php on line 2093