Thank you for all your help and advice n3on. Hopefully I will clean up things a little bit.. bit by bit.
On Friday, January 18, 2013 8:14:20 PM UTC+1, n3on wrote: > > Hmm, it's hard to tell how you can improve your code. First of all I would > prefer classes. Then you can create an instance for each category and hold > the images just for these categories in there and handle all the > eventhandling for each category in there. Overall i think a good rule to > follow is to keep methods small and give them names which explain what they > are doing. Also variable names should be chosen in a way you know what is > in there. If the code is readable and understandable without comments which > have to explain what happens it is good way.. > > But there are personal preferences, everybody has slightly different > opinions about how things should be done. But I think if you have your own > rules and always follow and improve them you are on a good way. If another > developer has to understand your code he "just" has to learn your > "philosophy". It's very hard to say how it is done the best, the libs are > always getting improved, new ideas coming up on how to solve some problems > and this changes a lot. Sometimes performance is more important than code > readability and so on.. i think you get the hint :) > > Best, > Steffen > > On Friday, January 18, 2013 4:08:18 AM UTC+1, Fuman wrote: >> >> Thanks Steffen for the tip. It helped a lot. >> >> I wish I could clean & improve the code. As a ansi c programmer I have a >> hard time in MooTools universe. If you have any advice how to clean it just >> a bit, please let me know. >> >> Best, >> Andy >> >> On Friday, 18 January 2013 00:04:46 UTC+1, n3on wrote: >>> >>> Couldn't you just check in the callback if the img URL is matching the >>> selected gallery? Not the cleanest solution, but you don't have the >>> cleanest code (no offense) so that's maybe all it takes :) >>> >>> Best, >>> Steffen >>> >>> >>> On Thursday, January 17, 2013 5:42:13 PM UTC+1, Fuman wrote: >>>> >>>> Hi. I'm Fuman and this is my first post in this group. >>>> >>>> I have made a gallery for one very talented photographer, but it >>>> doesn't work as expected. >>>> >>>> My general idea was to load dynamically images via Asset.image (one by >>>> one), on first Asset.image error callback I know, that there are no more >>>> images on the server, so I stop. When I want to go to different gallery I >>>> first fade out all pictures, then I'm deleting objects, delaying a little >>>> bit and I'm erasing my image holder div, so it is empty and loading new >>>> gallery. >>>> >>>> It works as expected, except that sometimes it grabs old picture, from >>>> previous gallery. It is probably because all images from previous loading >>>> were not finished, although I fetched them, but abandoned putting them in >>>> gallery by ignoring what the dealing with the image on finish. >>>> >>>> Can anyone help me with that problem? >>>> >>>> The gallery link is www.liberrafoto.com >>>> >>>> PS. I'm not too skilled in MooTools, so the code may appear little >>>> untidy. >>>> >>> --