Fancybox iframe标题链接

问题描述:

我遇到问题。我有一个页面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

在您$.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