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

Using Objects in Boxes does not allow scrolling #91

Closed RyanEricW closed 11 years ago

RyanEricW commented 12 years ago

http://rfiles.org/_in/index.php?idx=videos

Normally you can click on "boxes" either to the left or right, and it will scroll without activating the content. While using code provided by youtube, it triggers the video without scrolling to that slide. Is there a way I can fix this?

Thanks

Mottie commented 12 years ago

I think the easiest solution might be to give the non-current panel videos a negative z-index so that when you click, you're actually clicking on the div inside of the panel, the following would be all the extra css you would need - demo

.mb-inside object, .mb-inside embed {
    position: relative;
    z-index: -1;
}
.current .mb-inside object, .current .mb-inside embed {
    position: relative;
    z-index: 1;
}

Note: I set the reducedSize option to 1 to keep all of the panels the same size, because if I remember correctly, Firefox will reload/reset the video every time it gets resized.

RyanEricW commented 12 years ago

ah very nice, it worked! :D Thank you very much

RyanEricW commented 12 years ago

Hmm weird, it works fine in chrome, but for IE9 I still have the original issue. In safari on the iphone, it only has the issue on videos I play, then go to another slide, then try to come back, it activates the video again =\

Mottie commented 12 years ago

Grrr IE causing trouble again.... all it needed as for the video to have a wmode="opaque" added to the embed. Try this update: http://jsfiddle.net/Mottie/acV4n/53/

As for Safari on the iphone, I don't own an iOS device, so there isn't any way for me to test it =(