2010-12-10 49 views

回答

5

這是我的頭頂。但我相信你可以做這樣的事情:

<script type="text/javascript"> 
function call_cbox() 
{ 
    jQuery.colorbox({html:'<p>Hi There I was instantiated onclick!</p>'}); 
} 
</script> 
<a href="#" onclick="call_cbox(); return false;">Give me a colorbox... NOW! And don't forget the color.</a> 
19

前面的例子並沒有爲我工作,但使用相同的想法,這樣做的工作:

<script> 
function lightbox(){  
    $.colorbox({width:"80%", height:"80%", iframe:true, href:"/pagetoopen.html"}); 
} 
</script> 

<input type="button" value="open the box" onClick="lightbox()"/> 
2

兩個答案的混合上述工作對我來說:

<script> 
function call_cbox() 
{ 
jQuery().colorbox({width:"900px", height:"600px", iframe:true, href:"/newsletter.html"}); 
} 
</script> 
+0

看來,這不是爲我工作了。我不知道它是來自Colorbox更新還是jQuery更新。 – Keith 2013-02-19 20:31:56

0
$("tr").click(function() { 

    $.colorbox({width:"900px", height:"600px", iframe:true, href:"http://www.google.com"}); 

}); 
相關問題