代码之家  ›  专栏  ›  技术社区  ›  Derek Adair

单击时以编程方式更改colorbox的宽度/高度

  •  2
  • Derek Adair  · 技术社区  · 15 年前

    我正在使用jquery插件 ColorBox .

    我有一个页面有几个项目列表。每个列表都附有一个颜色框。

    $("a.modalButton").each(function(){
        $(this).colorbox({
            width:"933px", 
            height:"720px", 
            iframe:true, 
            onComplete:function(){ 
                //remove the text from the close button
                //wasn't sure how else to do that
                $('#cboxClose').html('');
                }
        });
    });
    

    在每个colorbox窗口中都有一个“email me”按钮。单击它时,我将窗口中的HTML内容替换为一个表单,以通过电子邮件发送列表。

    单击此按钮后,我希望调整窗口大小以适应窗体

    1 回复  |  直到 14 年前
        1
  •  4
  •   karlw    14 年前

    比如说:

    $('.email_me_class').click(function() {
      $.colorbox.resize() 
    })
    

    只是把它扔掉了,以前从没用过这个插件。