Hi everybody... Let me introduce myself, i'm a web designer and i'm learning javascript to extend my set of skills. i developed the javascript image gallery on my web site:
http://kosmonot.bl1nd.com i work on a mac and on mac browser it work almost all right. I do have an issue when you click to fast on the same button, then everything goes wild. On pc, well I'm afraid it does not work. I did all this gallery in plain old javascript, learning fron different sources, but let me tell you it's hard work. I then read about jquery and decided to redo everything with it, even if i prefer to do it in plain old javascript to learn javascript first. But i need this thing working and i've been seduced by jQuery and its selector access. Now it's a different approach and it's a bit confusing for me. but anyway here comes the point. I have different series of thumbnails and i want to load and expand the full images, one by one like on my current page. As well i want to manage the which image is selected, apply a class to the thumbnail and remove it when deselected. my first try was fun with the toggleClass() function. but when i click on a different image i need to deselect the previous one. I tried to keep the toggleClass() as a base and check if the image selected is different, then toggle the class on the new one and remove it on the previous one. But i couldn't manage it. So i decided to use an array to store the value like in this: http://kosmonot.bl1nd.com/gal_5.html http://kosmonot.bl1nd.com/j/jq001.js so far it works but i'm not sure there is not a more jQuery way to do it. anyway with the script remember which is the current picture and which is the previous one for every thumbnails in the page. However what i want to do is to di the same for each sections and have a local history for each one of those. that's where i start to have brain problem. in my plain old javascript thinking i woudl probably do a multidimentional array to stock each gallery and the history within each gallery. but when i think about it , create an object and let javascript do the work seems like a better idea, if ever it's possible. But Object Oriented javascript is not yet my cup of tea and the logic behind jQuery for this kind of work is a bit out of my grasp for now. i spent a couple of sleepless nights trying to find out how to do that, but i'm stuck. and now my javascript look like an empty page as i got mental with it. http://kosmonot.bl1nd.com/gal_6.html http://kosmonot.bl1nd.com/j/jq002.js i would be happy to spend a few more sleepless nights on this but at this moment i don't have a clue. could somebody enlighten me a bit on what to do, just point me in the right direction. like how do you create in the initialisation script something to remember each galleries and their stack history array or whatsoever. thank you very much People from the world for reading.