The color box does not open to the desired width and height when first clicked

I am using colorbox with ajax to pull out html files. When I click the download link for colorbox, the first time the width and height of the popup are small and the images and div inside will not be displayed. When I click the same link, the second color color opens up to the desired width and height settings.

In the script, I previously set the width to false so that it dynamically adjusts to the content. I had this problem and tried to change the width to 940, but still have this problem.

Any ideas what could be causing this?

(This site is jcoledesign.com)

+3
source share
3 answers

See this entry in the FAQ:

ColorBox ajax/inline- http://jacklmoore.com/colorbox/faq/#faq-img

+3

, ..

<img src='myimage.jpg' />

<img src='myimage.jpg' width=500 height=500 />
0

Another solution if someone needs it.

        $.colorbox({inline:true, href:"#form"},function(){
                $('#cboxContent').css("height","160");
                $('#cboxMiddleLeft').css("height","160");
                $('#cboxMiddleRight').css("height","160");                  
        });

You just need to set the “c” and “height” parameters according to the content that you have.

:)

0
source

All Articles