Ok, i'm not sure it was because of the floating images, but as I need it to float, I find another way by calculating the size of the div based on its width and the width of the images (which give me the total number of images per row, and I could find then the number of rows, so I find an approximation of the height).
For anyone interested, the result is here : http://www.o-gourmandise.com/gateaux/ (for those looking at the code, this is my first real mootools script, so it is probably too long and not very elegant. If something bothers you, drop me a message). Website is not really online, so you could drop a eye behind the curtain. On 5 jan, 11:00, Simon Vart <[email protected]> wrote: > Hi, > > I was thinking this night that maybe it is because my images are > floating (so they're out of the flux)... I don't have the time right > now but i'm confident this is it, now you're confirm that thinking to > me. > > Thanks you Darren > > On 5 jan, 09:24, fakedarren <[email protected]> wrote: > > > Sounds like one of two things: > > > 1) You are floating the image - this would make the <div> have a > > height of 0. You need to clear the float if this is the case. > > 2) You have cache disabled - and the image hasn' t loaded yet (so has > > a height of 0). Try deferring your measurement to onLoad() - does that > > fix it? > > > Cheers > > Darren > > > On Jan 5, 12:18 am, Ryan Florence <[email protected]> wrote: > > > > Can you extract a test case onhttp://mootools.net/shell? > > > > If those methods aren't working you've got other issues. > > > > On Jan 4, 2010, at 5:15 PM, Simon Vart wrote: > > > > > Yes, I have tried getSize().y > > > > > Truly guess I have tried everything... > > > > > On 5 jan, 01:02, cbolson <[email protected]> wrote: > > > >>> I have tried to use element.getProperty('height') ; used > > > >>> element.offsetHeight and also element.getScrollSize(); but I never > > > >>> manage to get the actual height of the div. > > > > >> Probably a silly question but have you tried getSize()? > > > >> ttp://www.docs.mootools.net/docs/core/Element/Element.Dimensions#Element > > > >> :ge... > > > > >> Chris > > > > >> On 5 ene, 00:53, Simon Vart <[email protected]> > > > >> wrote: > > > > >>> Hi all, > > > > >>> I'm trying to do a simple change. > > > > >>> I had set up a little image carousel, with back/fwd button to change > > > >>> view. This is two divs, one is containing the images, the other is a > > > >>> mask with a overflow: hidden; style. > > > > >>> I want to add a button to see all images in one clic. > > > > >>> Basically, what i'm doing on clic is : > > > > >>> - Change the width on the div containing all images (so the images, > > > >>> instead of being in one single line, are disposed on the div). > > > > >>> - Then I want to get to new height of the div in order to calculate > > > >>> the effect to apply on the mask layer and make a transition to this > > > >>> height (slowly revealing the images). > > > > >>> But ! > > > > >>> I have tried to use element.getProperty('height') ; used > > > >>> element.offsetHeight and also element.getScrollSize(); but I never > > > >>> manage to get the actual height of the div. > > > > >>> If I set the height of the div in the css : I get the same value > > > >>> that > > > >>> i had set up. If I'm not setting any value anywhere, the value is > > > >>> undefined, or 0. I had check the syntax : if I want to get the width > > > >>> of the > > > > >>> Is there a way to know the height of this div ? > > > > >>> (I cannot put a value on it, because the function will be use on > > > >>> different pages, with different content, so the height of the div > > > >>> could considerably change) > > > > >>> Thank you, this may be a dumb question, but I've tried to find out > > > >>> without success.
