javascript - Fancybox video popup not showed -


this html want use gallery show videos inside frame when pop up:

<ul id="gallery-v">     <li> <a class='video' href='video youtube'><img src='img/2.png' alt=''></a></li>     <li> <a class='video' href='video youtube'><img src='img/1.png' alt=''></a></li> </ul> 

i want adapt html create same gallery images:

$(window).load(function () {     // gallery     if (jquery("#gallery-v").length) {         // fancybox         jquery("#gallery-v li a").fancybox({             "titleshow": false,                 "transitionin": "elasti",                 "transitionout": "elastic",                 "closebtn": true         });          var totalimages = jquery("#gallery-v > li").length,             imagewidth = jquery("#gallery-v > li:first").outerwidth(true),             totalwidth = imagewidth * totalimages,             visibleimages = math.round(jquery("#gallery-video").width() / imagewidth),             visiblewidth = visibleimages * imagewidth,             stopposition = (visiblewidth - totalwidth);          jquery("#gallery-v").width(totalwidth);          jquery("#gallery-prev-v").click(function () {             if (jquery("#gallery-v").position().left < 0 && !jquery("#gallery-v").is(":animated")) {                 jquery("#gallery-v").animate({                     left: "+=" + imagewidth + "px"                 });             }             return false;         });          jquery("#gallery-next-v").click(function () {             if (jquery("#gallery-v").position().left > stopposition && !jquery("#gallery-v").is(":animated")) {                 jquery("#gallery-v").animate({                     left: "-=" + imagewidth + "px"                 });             }          });         $("a.video").click(function () {             $.fancybox({                  iframe: {                     preload: false                 }                 maxwidth: 800,                 maxheight: 600,                 fittoview: false,                 width: "70%",                 height: "70%",                 autosize: false,                 closeclick: false,                 openeffect: "elastic",                 closeeffect: "none"              });         });         return false;     } }); 

try this

 <a class="various iframe" href="http://www.youtube.com/embed/l9szn1qqfas?autoplay=1">youtube (iframe)</a> 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -