彩盒头痛

时间:2013-01-10 07:15:23

标签: jquery jquery-plugins colorbox

我制作了一个从xml文件中提取信息的播放列表。通过单击超链接调用视频。我正在尝试添加彩盒,我已经拿到了盒子,但我无法弄清楚如何让视频打开到彩盒中。这是我使用的代码:

$(function() {
   /* be sure data is defined here */
$( data ).find("chapter").each(function() {

    var $chapter = $('<li class="chaptertitle"/>')
    .append('<img class="img-swap" src="http://sandbox.kalliance.com/demo/images/plus.png" class="img-swap" />')
    .append('<p align="left" class="pc-left">' + $(this).attr("label") + '<p align="right" class="pc-right">Duration</p>')
    .append('<ul/>')
    .appendTo( '#screens' );
    $(this).find('screen').each(function() {
        time=$(this).find('screen').attr('duration')
        $("#screens").append(time)
         $('#screens ul:last')
         .append('<li class="screentitle"/>')
         .find('li:last')
         .append('<p align="left" class="p-left"><a href="'+streamer+''+filenum+'/streams/_definst_/' + $(this).attr('path') + '" id="colorbox-load">' + $(this).attr('label') + ' </a></p>  <p align="right" class="p-right">'+ $(this).attr("duration")+'</p>');

         //tgonzalez - create the modal window for the video

       $("#colorbox-load").click(function() {
        $.colorbox({inline:true, width:960, height:540, opacity:0.8 });

1 个答案:

答案 0 :(得分:0)

jquery的colorbox API会引用您尝试在颜色框中打开的容器。试试这个

$.colorbox({href: "#divIdHere", inline:true, width:960, height:540, opacity:0.8 });
相关问题