0
<script type='text/javascript'>//<![CDATA[ 
    $(function(){
    $(".fancybox")
     .attr('rel', 'gallery')
     .fancybox({
         type: 'iframe',
         autoSize : false,
              arrows: false,
              topRatio: 0.4,
        openEffect  : 'none',
        closeEffect : 'none',
        nextEffect  : 'none',
        prevEffect  : 'none',
        padding     : 3,
        margin      : [20, 60, 20, 60], // Increase left/right margin
              helpers : {
                    overlay : {
                            css : {
                                'background' : 'rgba(0, 0, 0, 0.6)'
                                    }
                             },
                            title: {
                            type: 'outside'
                                  }                          
                            },
         beforeLoad : function() {                    
             this.width = parseInt(this.href.match(/width=[0-9]+/i)[0].replace('width=',''));  
             this.height = parseInt(this.href.match(/height=[0-9]+/i)[0].replace('height=',''));
         }
     });
    });//]]>  
</script>

<a class="fancybox fancybox.iframe" href="http://www.example.com/charts/chart1.php?width=440&height=620" rel="gallery" title="Chart1">Chart1</a>

我最近安装了 fancyBox 来显示各种图表,它按预期运行。但是,在某些情况下,我希望通过 fancyBox 链接打开我网站的主页 ( http://www.example.com/index.php ) 并在那里展示图表。

即,从不我主页上的fancyBox 链接中,我想:(1) 打开一个新窗口,(2) 转到我网站的主页,以及(3) 显示chart1.php。

那实用/可能吗?如果是这样:如何?谢谢。(fancyBox 的新手)

4

0 回答 0