2010-12-01 8 views
6

Cómo invocar un thickbox usando la función javascript. Estoy usando este códigoPara invocar thickbox usando javascript

 
//javascript function 
function click_fn() 
{ 
self.location="upload.php?keepThis=true&TB_iframe=1&width=1000&height=400&model=true"; 
} 

Respuesta

17

Calling Thickbox a través de JavaScript

 

var url = "http://www.blah.com/something?KeepThis=true&TB_iframe=true&width=300&height=200"; 
tb_show("My Caption", url); 

Sintaxis: tb_show (título, url, ImageGroup)

Código permite llamar thickbox desde JavaScript.

+0

Excelente. Me ahorró tanto tiempo :) –

2

Puede desencadenar tb_show con HTML en línea, así:

tb_show("Modal title", "#TB_inline?inlineId=modal_container"); 

Cuando se utiliza texto que garantizar para mantenerlos en p etiquetas. El texto de la etiqueta del casillero debe ser HTML válido (con etiqueta para), de lo contrario, la etiqueta se rayará.

<div id="modal_container" style="display:none;"> 
    <p> 
     Example Text 
    </p>  
    <input type="checkbox" name="checkbox_name" id="checkbox_name" value="value"> 
    <label for="checkbox_name">Example Label</label> 
</div> 
Cuestiones relacionadas