Loading icon still in the middle of the browser when using custom topRatio
I noticed that in Version 2 of FancyBox, the loading icon gets not centered in the wrap-container, when you use a different topRatio than 0.5
Change the topRatio to 0.15, and comment the first line in the _afterLoad function -> F.hideLoading(); (just to make sure you see the loading icon). The icon is still in the middle of the browser window, while the fancyBox container is at the top of the window. Shouldn't the loading icon follow the fancyBox window, or is this behavior volitional?
.
Currently loading icon is positioned with the use of CSS positioning as I wanted to avoid extra JS call -
#fancybox-loading {
position: fixed;
top: 50%;
left: 50%;
margin-top: -21px;
...
}
If you really need to set different position, you can change loading method. It is very easy -
$.fancybox.showLoading = function () {
var pos = { top : 100, left : 100}; // Set custom position, maybe calculate from window height
F.hideLoading();
$('<div id="fancybox-loading"></div>').css(pos).click(F.cancel).appendTo('body');
}
(Add code after including fancybox.js)
Ok, this makes sense. Thank you very much.
In a similar way, the 'next' and 'prev' click areas do not only cover the image, but they also extend to the title (at least when you have the title on the outside). I added a new div underneath the title, which helps me display a description to the image. If this description gets too long, the 'next' and 'prev' icons are not over the actual image anymore.
You are right, thanks for noticing and reporting
Hi, I changed a location for navigation arrows in one of the recent commits. Download and try the latest - https://github.com/fancyapps/fancyBox/zipball/master
HI, thank you very much.