I'm using a colorbox to open when the user first visits the page (using cookies). The box contains a 520x520 image. My css is as follows:
#hunger-count{
padding: 5px;
overflow: hidden;
}
#hunger-count img{
width: 100%;
height: auto;
}
Function call:
if (visited == null) {
$.cookie('visited', 'yes');
$.colorbox.settings.height = 560;
$.colorbox.settings.width = 520;
$.colorbox({html:"<div>...</div>"});
}
I want those to be the maxWidth & maxHeight, and set a width to be about 80% of the screen. The problem here is that depending on what height percentage I set, the image skews funny on different devices. I have a Huawei android phone, and when I set a good height and width ratio on my phone, it looks funny on an iPhone, and vice versa. Setting an 80% width and an auto height came up with the same result.
Any suggestions as to how I can do this?