Open mrSingh007 opened 5 years ago
After further analysis, it was found that as $loaded was hidden when getWidth & getHeight methods were called, which somehow did not calculated correct width and height in chrome but was working fine in Firefox. So the solution of this problem is to keep showing $loaded till width and height is not calculated. Afterwards $loaded.hide(); can be called.
So here is solution for this problem:
$loaded.appendTo($loadingBay.show()).prependTo($content);
$loaded.show(); // keep showing so that after rendering width/height can be calculated correct
$loaded.css({width:getWidth(),height: getHeight(),overflow: settings.get('scrolling') ? 'auto' : 'hidden'});
$loaded.hide(); //now can be called hide
$loadingBay.hide();
@jackmoore Please review and take this solution. Thanks
Current State On very first click in chrome width of pop layout is small as compared to width of content in Firefox. In chrome if second time same pop-up is triggered (colorbox) then the width/height are correct and width/height is same as in Firefox
After deep analysis it is found that this part of function is inconsistent and gives different results.
Here getWidth function is giving different results in chrome as compared to firefox
Chrome Browser Info:
Jquery version: 3.3.1 Colorbox version: 1.6.4