/ Published in: HTML
The first HTML slide contains a hack that will grab the current SlideDeck object and then bind an onComplete callback to append '?autoplay=1' to the iFrame URL when the deck lands on a slide that has an iFrame in it.
The other HTML slides have Vimeo iFrames in them that are treated the same when the deck animates to them as well.
The JavaScript is only necessary in one of the slides.
Expand |
Embed | Plain Text
<!-- First HTML Slide --> <script type="text/javascript"> jQuery(document).ready(function(){ deckElement = jQuery('#hack-the-iframe').parents('dl.slidedeck'); deckElement.slidedeck().options.complete = function(deck){ var thisSlideiFrame = deckElement.find('dd:eq(' + ( deck.current - 1 ) + ')').find('iframe'); if( thisSlideiFrame.length ){ if( !thisSlideiFrame.attr('src').match(/autoplay=1/) ){ thisSlideiFrame.attr('src', thisSlideiFrame.attr('src') + '?autoplay=1' ); } } } }); </script> <!-- End of First HTML Slide --> <!-- Other HTML Slide --> <!-- Other HTML Slide -->
You need to login to post a comment.
