Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing fancybox to open a gallery that contain embedded youtube videos
    primarykey
    data
    text
    <p>I need to have a link on my web page that says 'videos' and when it's clicked a fancybox gallery opens with the first of 1 or more videos displayed. Does anyone have an example of how to do this? </p> <p><a href="https://stackoverflow.com/questions/2542252/open-youtube-video-in-fancybox-jquery">This stackoverflow post</a> explains clearly how to open a window with one Youtube video. I'd like to open a gallery with 'next' and 'back' buttons to navigation between the videos. </p> <p>Here's some code I have to open one div with an iFrame, for example. I obviously need to update the "id" of the div containing the video to be use "class" so I can have multiples. But I don't get how to change the href to then know what to load. Changing it to ".myVid" doesn't work.</p> <pre><code>$("a#myTest").fancybox({ 'transitionIn': 'elastic', 'transitionOut': 'elastic', 'speedIn': 600, 'speedOut': 200, 'overlayShow': false, 'type': 'inline' </code></pre> <p>});</p> <pre><code>&lt;a id="myTest" href="#myVid" rel="group1"&gt;display video gallery&lt;/a&gt; &lt;div style="display:none"&gt; &lt;div id="myVid" rel="group1" style="height: 400px;" &gt;&lt;iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/9QrFa3tDwvY" frameborder="0" allowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/div&gt; </code></pre> <p>This is the example form the Fancybox site showing how to group items using the rel attribute. But their example only shows how to group things that are already visible on the page and where the link for launching the slideshow is one of the items IN the slideshow. I want a separate link to launch mine. </p> <pre><code>$("a.grouped_elements").fancybox(); &lt;a class="grouped_elements" rel="group1" href="Image1.jpg"&gt;&lt;img src="Image1.jpg" height="20" width="20" alt=""/&gt;&lt;/a&gt; &lt;a class="grouped_elements" rel="group1" href="Image2.jpg"&gt;&lt;img src="Image2.jpg" height="20" width="20" alt=""/&gt;&lt;/a&gt; </code></pre> <p>And here's another example that 'almost' works. Although the problem it has is that the first item in the gallery it wants to open is blank... as it's the item of the hyperlink that opened the gallery. </p> <pre><code>&lt;a class="video_elements" rel="shadowbox"&gt;launch videos&lt;/a&gt; &lt;div style="display:none"&gt; &lt;a href="http://www.youtube.com/v/znyMx58fZqQ" class="video_elements" rel="shadowbox"&gt;video link &lt;/a&gt; &lt;a href="http://www.youtube.com/v/znyMx58fZqQ" class="video_elements" rel="shadowbox"&gt;video link &lt;/a&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; $("a.video_elements").fancybox({ 'transitionIn' : 'fade', 'transitionOut' : 'fade', 'titlePosition' : 'inside', 'autoscale' : 'true', 'type' : 'swf' }); </code></pre> <p></p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload