0

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 });
4

1 に答える 1

0

jquery のカラーボックス API は、カラーボックスで開こうとしているコンテナーの参照を受け取ります。これを試して

$.colorbox({href: "#divIdHere", inline:true, width:960, height:540, opacity:0.8 });
于 2013-01-10T07:43:49.383 に答える