Programmatically change the width/height of ColorBox onClick.

Posted by Derek Adair on Stack Overflow See other posts from Stack Overflow or by Derek Adair
Published on 2010-04-15T13:56:54Z Indexed on 2010/05/28 12:22 UTC
Read the original article Hit count: 381

Filed under:
|

Hi,

I'm using the jquery plugin ColorBox.

I have a page with several item listings. Each listing has a ColorBox attached to it.

$("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('');
            }
    });
});

In each ColorBox window there is an "email me" button. When it is clicked I replace the html content that is in the window with a form to email the listing.

I would like the window to resize to fit the form after this button is clicked

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about colorbox