1jQuery.fn.videopopup = function (options) { 2 var settings = { 3 videoid: "", 4 videoplayer: "youtube", 5 width: "500px", 6 height: "300px", 7 autoplay: "false" 8 }; 9 return this.each(function () { 10 if (options) { 11 $.extend(settings, options) 12 } 13 function centerS(cur) { 14 var cur = cur; 15 cur.css("position", "absolute"); 16 cur.css("top", ($(window).height() - cur.height()) / 2 + $(window).scrollTop() + "px"); 17 cur.css("left", ($(window).width() - cur.width()) / 2 + $(window).scrollLeft() + "px"); 18 return this 19 } 20 $(this).click(function (e) { 21 var a = $(document).height(); 22 var b = $(window).width(); 23 e.preventDefault(); 24 var popuphtml = '<div id="dvGlobalMask"></div><div id="videopopup"><div class="modalnav"></div><div id="videocontent"></div></div>'; 25 $("body").append(popuphtml); 26 $("#dvGlobalMask").css({ 27 width: b, 28 height: a 29 }); 30 $("#dvGlobalMask").fadeTo("fast", 0.4); 31 $("#videopopup").css("width", settings.width); 32 $("#videopopup").css("height", settings.height); 33 centerS($("#videopopup")); 34 var autoplay = 0; 35 if (settings.autoplay == "true") { 36 autoplay = 1 37 } else { 38 autoplay = 0 39 } 40 youtubestr = '<iframe width="' + settings.width + '" height="' + settings.height + '" src="http://www.youtube.com/embed/' + settings.videoid + "?autoplay=" + autoplay + '&showinfo=0" frameborder="0" allowfullscreen></iframe>'; 41 vimeostr = '<iframe src="http://player.vimeo.com/video/' + settings.videoid + "?color=00adef&show_title=0&show_portrait=0&autoplay=" + autoplay + '" width="' + settings.width + '" height="' + settings.height + '" frameborder="0"></iframe>'; 42 switch (settings.videoplayer) { 43 case "youtube": 44 $("#videocontent").html($(youtubestr)); 45 break; 46 case "vimeo": 47 $("#videocontent").html($(vimeostr)); 48 break 49 } 50 $("#videopopup").show(); 51 $(".modalnav").show() 52 }); 53 $(".modalnav").live("click", function () { 54 $("#dvGlobalMask").hide(); 55 $("#videopopup").hide(); 56 $(".modalnav").hide(); 57 $('#videocontent').html(''); 58 $(settings.videoid).hide() 59 }) 60 }); 61 return this 62};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.