Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Colorbox jquery Uncaught RangeError: Maximum call stack size exceeded

I use colorbox.js with a modal, that's loaded by ajax.

I get some errors

Uncaught RangeError: Maximum call stack size exceeded. you can check the test-side on http://selfmade01.bplaced.net/

Please use there the second button "modal load mit ajax geht jetzt bis auf colorbox"

Can anyone help?

Thanks a lot for any help.

Best regards.

Jürgen

Now it works fine.

I added this:

onOpen:function(){
    $overflow = document.body.style.overflow;
    document.body.style.overflow = 'hidden';
},
onClosed:function(){
    document.body.style.overflow = $overflow;
    $("#my-modal").modal('show');
    //document.body.style.overflow = 'auto';
},
onComplete:function(){
    $("#my-modal").modal('hide');
    $.colorbox.resize();

modal").modal('hide');
and 
modal").modal('show');

Works for me.

Best regards. }

like image 911
selfmade Avatar asked Mar 21 '15 13:03

selfmade


2 Answers

I know this is an old question, but the solution is described in the answer by user2257275 here.

Basically set trapFocus to false and that should take care of the error:

.colorbox({
    height: "320",
    width: "300",
    ...
    trapFocus: false
});
like image 181
Eamonn Avatar answered Nov 03 '22 00:11

Eamonn


I had similar error - when I performing click on expanded colorbox or pushing Esc or other way to hide it jQuery (1.11.3) thrown "Maximum call stack size exceeded", seems colorbox has some bug ...

Since this question is in the top of google, I've decided to share simplest drop-in solution of this problem – replace "colorbox" with "lightbox" :D

http://lokeshdhakar.com/projects/lightbox2/

like image 25
madzohan Avatar answered Nov 03 '22 02:11

madzohan