bkosborne / jQuery-Waterwheel-Carousel

GNU General Public License v3.0
105 stars 69 forks source link

movedToCenter is fired twice on page load #4

Closed clekstro closed 11 years ago

clekstro commented 13 years ago

I'm calling a function that launches a flowplayer instance (by the way, help with video integration would be awesome!) that is triggered by the movedToCenter event. Not only does it fire once on page load -- which might not be expected from the name -- but it fires again approximately 1.5 seconds later. I haven't had this error with the clickedCenter event when using $flowplayer().load().

The problem can be triggered with a simple alert message like the following example: ... movedToCenter: function($newCenterPic){ var newURL = $newCenterPic.parent().attr('href'); alert(newURL);

The dialog box will then appear twice.

bkosborne commented 13 years ago

Interesting. I assumed people would want moved to center to fire right away in case they are showing content that should appear by default, but I suppose that can be handled outside of the carousel. I'll alter that functionality in the dev release tonight and you can download that. Is the movedToCenter function firing twice without the carousel even moving?

I have a pretty good amount of experience working with Flowplayer. What sort of integration are you doing?

Brian

On Tue, Jun 7, 2011 at 7:42 AM, frosch62 < reply@reply.github.com>wrote:

I'm calling a function that launches a flowplayer instance (by the way, help with video integration would be awesome!) that is triggered by the movedToCenter event. Not only does it fire once on page load -- which might not be expected from the name -- but it fires again approximately 1.5 seconds later. I haven't had this error with the clickedCenter event when using $flowplayer().load().

The problem can be triggered with a simple alert message like the following example: ... movedToCenter: function($newCenterPic){ var newURL = $newCenterPic.parent().attr('href'); alert(newURL);

The dialog box will then appear twice.

Reply to this email directly or view it on GitHub: https://github.com/bkosborne/jQuery-Waterwheel-Carousel/issues/4

clekstro commented 13 years ago

Hey Brian, Thanks for the quick turnaround time! It is indeed firing twice without any carousel movement.

As to the flowplayer integration, what I'm looking for is one of the following: On page load, the carousel is filled with flowplayer instances which will play if they are clicked while in the center of the carousel. Otherwise, normal carousel functionality. But I wasn't able to get the two of them to play nicely together. (As a matter of full disclosure, I'm a beginning javascript/php developer). The second possibility -- and the one I'm working on as we speak -- is by creating another div that hovers above the center picture when movedToCenter is triggered, then "disappears" and is then replaced by a new player when the carousel is rotated; I've gotten stuck there closing a flowplayer instance, as the .unload() and .close() methods don't seem to do what I want them to. movedToCenter is practical as is in this case, as it launches on start -- but with the nuisance that flowplayer loads twice. In general, the second solution seems like more of a faked hack to make it appear like the first solution is working.

Thanks again for your quick response!

bkosborne commented 11 years ago

I've released version 2.0 which has fixed this bug.