Change width / height of ColorBox onClick programmatically

I am using jquery ColorBox plugin .

I have a page with multiple line item lists. 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('');
            }
    });
});

      

An "Email me" button appears in each ColorBox window. 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 clicking this button

+2


a source to share


1 answer


How about something like:

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

      



just throwing it in there, never used this plugin before.

+4


a source







All Articles