2010-03-31 28 views
0

如何在彈出的lightbox類型框中彈出嵌入代碼?如何在lightbox類型彈出框中播放嵌入代碼

這裏是整個代碼

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    <meta http-equiv="imagetoolbar" content="no" /> 
    <title>FancyBox 1.3.1 | Demonstration</title> 
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> 
    <script type="text/javascript" src="./fancybox/jquery.mousewheel-3.0.2.pack.js"></script> 
    <script type="text/javascript" src="./fancybox/jquery.fancybox-1.3.1.js"></script> 
    <link rel="stylesheet" type="text/css" href="./fancybox/jquery.fancybox-1.3.1.css" media="screen" /> 
    <link rel="stylesheet" href="style.css" /> 
    <script type="text/javascript"> 
     $(document).ready(function() { 
      /* 
      * Examples - images 
      */ 

      $("a#example1").fancybox({ 
       'titleShow'  : false 
      }); 

      $("a#example2").fancybox({ 
       'titleShow'  : false, 
       'transitionIn' : 'elastic', 
       'transitionOut' : 'elastic' 
      }); 

      $("a#example3").fancybox({ 
       'titleShow'  : false, 
       'transitionIn' : 'none', 
       'transitionOut' : 'none' 
      }); 

      $("a#example4").fancybox(); 

      $("a#example5").fancybox({ 
       'titlePosition' : 'inside' 
      }); 

      $("a#example6").fancybox({ 
       'titlePosition' : 'over' 
      }); 

      $("a[rel=example_group]").fancybox({ 
       'transitionIn'  : 'none', 
       'transitionOut'  : 'none', 
       'titlePosition'  : 'over', 
       'titleFormat'  : function(title, currentArray, currentIndex, currentOpts) { 
        return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + '/' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>'; 
       } 
      }); 

      /* 
      * Examples - various 
      */ 

      $("#various1").fancybox({ 
       'titlePosition'  : 'inside', 
       'transitionIn'  : 'none', 
       'transitionOut'  : 'none' 
      }); 

      $("#various2").fancybox(); 

      $("#various3").fancybox({ 
       'width'    : '75%', 
       'height'   : '75%', 
       'autoScale'   : false, 
       'transitionIn'  : 'none', 
       'transitionOut'  : 'none', 
       'type'    : 'iframe' 
      }); 

      $("#various4").fancybox({ 
       'padding'   : 0, 
       'autoScale'   : false, 
       'transitionIn'  : 'none', 
       'transitionOut'  : 'none' 
      }); 
     }); 
    </script> 
</head> 
<body> 
<div id="content"> 
    <p> 
     <a id="example1" href="./example/1_b.jpg"><img alt="example1" src="./example/1_s.jpg" /></a> 

     <a id="example2" href="./example/2_b.jpg"><img alt="example2" src="./example/2_s.jpg" /></a> 

     <a id="example3" href="./example/3_b.jpg"><img alt="example3" src="./example/3_s.jpg" /></a> 
    </p> 
</div> 
<div><p>&nbsp;</p></div> 
</body> 
</html> 

這上面的代碼用於圖像可以正常使用。但是,我應該如何播放嵌入代碼而不是圖像。

這裏是示例嵌入代碼。

<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/WUW5g-sL8pU&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/WUW5g-sL8pU&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object> 

在此先感謝...

回答

0

有幾個收藏的腳本,讓你在覆蓋自動嵌入YouTube視頻。

http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/是一個jQuery的在這種情況下,但也有幾十個,如果你谷歌它,jQuery的,原型,MooTools的,...

+0

嗨Ramakers ......一個小概率與腳本...它只有在我們提供URL的情況下才能正常工作,但如果我們給出嵌入的代碼,它就不能正常工作了。是否有其他建議 – Fero 2010-04-02 05:07:16

+0

從嵌入代碼中提取視頻ID並形成一個url並不困難。據我所知,與嵌入代碼一起使用的燈箱腳本是我之前沒有見過的,所以我不認爲它可能就我所知。 – ChrisR 2010-04-02 11:11:32

相關問題