mootools modalbox with checkbox
I am have implemented a modalbox into my website, the w开发者_Go百科orks on a <a>
like below,
<a href="http://www.example.com" rel="moodalbox">External Site</a>
Click this link will launch example.com in a modal window. I am wanting to recreate this effect however instead of using a link I would like to use a checkbox, is this possible? I know that checkboxes do not support rel
or href
, so with mootools is there a way to put a listener on the checkbox and launch the modal box to a specified url?
Any help or advice would be greatly appreciated.
A quick workaround can be clicking on a hidden link. On click of checkbox.
Also the method below can help you override modalbox behaviour
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
});
精彩评论