0

我有以下代码:

window.addEvent('domready', function(){var myBox = new BoxMenu({items: [['Card Info', 'item_1.png',function(){ window.location = "card"; }],]});});

此代码创建一个框菜单项,单击它会打开“卡片”窗口。没问题。

但我不希望用户离开主窗口,所以我决定使用 jQuery colorbox。

我需要知道如何调用调用颜色框脚本的 iframe 类以从该页面打开。

通常(仅在一页中)通过以下方式完成:

<script>
    jQuery.noConflict(); 
    (function($) { 
    $(document).ready(function(){
        $(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
        $("#click").click(function(){ 
            $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
            return false;
        });
    });
          })(jQuery); 
</script>

then the HTML 

<p><a class='iframe' href="reach.html">Outside Webpage (Iframe)</a></p>

但在这种情况下,框菜单就是链接本身。有人可以帮忙吗?

提前致谢

4

1 回答 1

0

我找到了解决方案。

在 window.event 中,颜色框的调用方式如下:

['Card Info', 'item1.png',function call_cbox(){jQuery().colorbox({width:"80%", height:"80%", opacity:0.8, iframe:true, href:"reach.html"});}],

谢谢你,希望这也能帮助别人。

于 2011-11-24T09:28:04.710 回答