2013-04-30 82 views
0

我遇到問題。我有一個頁面http://www.hmaloha.com/bionutrient.php,當點擊播放按鈕時,一個視頻在fancybox iframe上播放,而一個徽標位於視頻加載時的頂部。現在我需要添加一個鏈接到該標誌。我一直在試圖改變fancybox的代碼,但沒有運氣。任何幫助?Fancybox iframe標題鏈接

$(document).ready(function(){ 
      $('#malohaStory').click(function(){ 
       $.fancybox({ 
        overlayOpacity: 1, 
        overlayColor: '#bbb', 
        padding : 0, 
        autoScale : false, 
        transitionIn : 'none', 
        transitionOut : 'none', 
        titleShow : true, 
        titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' 
        titleFormat : function(){ 
         return ' '; 
        }, 
        type: 'iframe', 
        href: 'http://hmaloha.com/js/flowplayer/video/index.html', 
        height: 545, 
        width: 920, 
        swf : { 
         wmode : 'transparent', 
         allowfullscreen : 'true' 
        } 
       }); 
       return false; 
      }); 


     }); 
+1

我想你已經把它排序了,不是嗎? – JFK 2013-04-30 16:26:17

回答

0

在您$.fancybox()電話,包括beforeLoad方法如下圖所示,改變了我的例子連接你url

beforeLoad: function() { 
    this.title = '<a href="http://www.example.com/link.html">' + this.title + '</a>'; 
} 

因此,最終的代碼(如果你珍惜你擁有的高於一切,雖然我不知道你的titleFormat功能在做什麼)看起來像這樣:

$(document).ready(function(){ 
     $('#malohaStory').click(function(){ 
      $.fancybox({ 
       overlayOpacity: 1, 
       overlayColor: '#bbb', 
       padding : 0, 
       autoScale : false, 
       transitionIn : 'none', 
       transitionOut : 'none', 
       titleShow : true, 
       titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' 
       titleFormat : function(){ 
        return '&nbsp;'; 
       }, 
       type: 'iframe', 
       href: 'http://hmaloha.com/js/flowplayer/video/index.html', 
       height: 545, 
       width: 920, 
       swf : { 
        wmode : 'transparent', 
        allowfullscreen : 'true' 
       } 
       beforeLoad: function() { 
        this.title = '<a href="http://www.example.com/link.html">' + this.title + '</a>'; 
       } 
      }); 
      return false; 
     }); 


    }); 
+0

我不認爲這有幫助,因爲'beforeLoad'是一個fancybox ** v2.x **回調,但OP使用** v1.3.4 **。 v2.x中的API選項是新的,與以前的版本不兼容。 – JFK 2013-04-30 16:23:04