CSS-Tricks / MovingBoxes

Simple horizontal slider which grows up the current box when it's in focus (image, title & text) and back down when it's not in focus.
http://css-tricks.github.io/MovingBoxes/
GNU Lesser General Public License v3.0
280 stars 147 forks source link

initAnimation: false not working #79

Closed Alfazo closed 11 years ago

Alfazo commented 12 years ago

Hi again!

I'm having an issue with "initAnimation: false" not working (and thus MovingBoxes scrolling the slider when I don't want it to) on page load.

A demo of this: http://alpha.may-ninth.co.uk/work

Please note that the scrollTop is normal/wanted behaviour, and not a bug with MovingBoxes.

Any help would be appreciated!

Mottie commented 12 years ago

Hmm, that is a problem. Thanks for reporting it.

Mottie commented 12 years ago

Ok, this should be fixed in v2.2.15.

Alfazo commented 12 years ago

Hmm, it seems that it's stopped it doing it on loading the first slide, but if you put in a specific slide — alpha.may-ninth.co.uk/work/#samme — it still scrolls.

Mottie commented 12 years ago

Hmm, yeah it was working fine locally, but with image loading delay I see it is still an issue... It's not a simple fix so give me a bit more time. Thanks!

Mottie commented 12 years ago

Ok, I ended up completely rewriting the initialization function so hopefully this bug has been stomped flat. :P

dubdesign commented 11 years ago

this problem seems to have reappeared for me. I'm using version 2.3.4 also when the slider animates to the chosen panel the "completed" callback is not firing so my image loader function that i run from within the callback is also not running. The initChange callback isn't firing either which i assume is the reason completed doesn't fire?

Mottie commented 11 years ago

@dubdesign Check out this (demo)... the slider starts on the third panel without the beginning animation and all events are showing up properly in the event window underneath.

So, it looks like everything is working perfectly to me. Are you not seeing the same thing? If not, what browser are you seeing the problem in? Are there any javascript errors on your page (press F12 and look at the console).

dubdesign commented 11 years ago

hi, thanks for your reply. Easiest thing is probably to show you an example http://samreedphotography.co.uk/gallery/wedding-photography-collection-2#1100

as you can see it opens up on the 1st image and then transitions to the selected image (which wont actually load for you), i use chrome and firefox and both have the same problem. I've added console.log messages on the callbacks so that you can see whats happening.

It has worked in the past but i dont know at what point it stopped as i've only just started using git so cant go back and look at changes

Thanks

Mottie commented 11 years ago

@dubdesign Hmm, I sorry I don't have a lot of time to troubleshoot the problem you're having... but from looking at the console log, I'm not sure why the "completed callback" is the first event and the "initialized callback... imageSwap has been called from initialized" is shown twice! The initialized function should only be called once.

So I added another call to the plugin in this demo and it did the same thing!...

completed... initialized... initialized

So look in your code for a second call to the plugin, and I'll open a new issue (#112) so I can keep track of this problem.

dubdesign commented 11 years ago

no problem, i appreciate you taking the time to look. I checked the code and the plugin is only called once. I've now reverted to v2.3 and that has fixed my problem so i guess something is conflicting with v2.3.4 in 2.3 i'm getting initialized... initChange... initialized... completed... so initialized is still being fired twice but it seems to function ok. might be worth mentioning that i use a window resize event which you helped me with previously, i dont know if that would have anything to do the the initialized being run twice??