This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
/* onloadでthickboxを開く */ | |
var src = "foo/bar.html?TB_iframe=true&modal=true"; // iframeでモーダルウィンドウを表示するパラメータ設定 | |
tb_show("", src, ""); // tb_show("キャプション", "表示するコンテンツのURL", "イメージグループ") | |
/* thickboxのiframe外部の領域をクリックしたらthickboxをcloseさせる */ | |
$('#TB_overlay').click(function(){ | |
tb_remove(); | |
}); | |
}); |
例に示したようにモーダルウィンドウのcloseはthickboxが動的に生成する#TB_overlay(モーダルウィンドウのウィンドウの外側のグレイになる領域を示す)のclickイベントでtb_remove関数をコールすることで実装できます。
参考:
FlashBLOG MVON.NET - FLASH、WEBに関する話題。 » Blog Archive » jQuery-ThickBoxをお好きなイベントで出す
0 件のコメント:
コメントを投稿