mootools modalbox帮助

时间:2010-05-21 11:01:52

标签: javascript javascript-events mootools modal-dialog

我已经在我的网站中实现了一个模态框,其中的作品如下<a>

<a href="http://www.example.com" rel="moodalbox">External Site</a>

点击此链接将在模态窗口中启动example.com。我想重新创建这个效果,但不是使用链接我想使用复选框,这可能吗?我知道复选框不支持relhref,所以使用mootools有办法在复选框上放置一个监听器并将模式框启动到指定的URL?

非常感谢任何帮助或建议。

1 个答案:

答案 0 :(得分:0)

快速解决方法可以点击隐藏的链接。点击复选框。

此外,下面的方法可以帮助您覆盖模态框行为


window.addEvent('domready', {

    /**
     * Set default options, overrideable from later calls.
     */
    SqueezeBox.initialize({
        size: {x: 350, y: 400}
    });

    /**
     * Assign SqueezeBox to all links with rel="boxed" attribute, the class then reads the "href".
     */
    SqueezeBox.assign($$('a[rel=boxed]'));

    /**
     * Open some content manually
     */
    SqueezeBox.open('manual.html'); // handler defaults to "ajax" for urls

    SqueezeBox.open('http://digitarald.de', {handler: 'iframe'}); // we force the "iframe" handler here ...

    SqueezeBox.open($('welcome'), {handler: 'adopt'}); // and here we force "adopt" handler
});