2010-06-29 120 views
2

我在一個頁面中,
現在的你知道,如果我們點擊了側ThickBox的頁面[黑色部分是指]使用ThickBox的,如何更改ThickBox的默認行爲?

,所以我想刪除的行爲,我想刪除如果用戶點擊了出暗的部分該頁面的側則該頁面不應該刪除,消失,它應該留在窗口的事情....意味着..

通過關閉ThickBox的頁面的唯一途徑單擊該「關閉」鏈接,

等也是他們沒有辦法做到這一點?

在此先感謝,
尼茨。

+0

在網址的結尾只是添加和模式。 #TB_inline?height = 300&width = 400&inlineId = pleaseloginagain&modal = true – pregmatch 2014-07-23 14:45:17

回答

1

在Thickbox.js去功能tb_show

在這個if語句:

if (typeof document.body.style.maxHeight === "undefined") {//if IE 6 
     $("body","html").css({height: "100%", width: "100%"}); 
     $("html").css("overflow","hidden"); 
     if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6 
      $("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>"); 
      $("#TB_overlay").click(tb_remove); //Remove me 
     } 
    }else{//all others 
     if(document.getElementById("TB_overlay") === null){ 
      $("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>"); 
      $("#TB_overlay").click(tb_remove); //Remove me 
     } 
    } 

您需要註釋掉包含$("#TB_overlay").click(tb_remove);兩條線。我在你應該評論的行上添加了//Remove Me的評論。

+0

謝謝Barry ....... – Nitz 2010-06-29 09:22:39

2

我知道這是一個老問題,但我發現另一種方式來做到這一點不改變ThickBox的源代碼後,我啓動的ThickBox窗口,我做到以下幾點:

tb_show('', 'website.php?inlineId=hiddenModalContent&amp;TB_iframe=true'); 
jQuery("#TB_overlay").off('click'); 

這消除了點擊動作,所以它變得像一個模式窗口而不會丟失標題欄。

0

這可以幫助你:-)

$("#TB_overlay").unbind("click",tb_remove); 
相關問題