Well at first I stopped your link and saw nothing wrong (was using Chrome) then went and tested by IE 11 and saw what was saying that the text within the DIV in the areas of projects tend to stay on top times yes, times no.
At first I thought to tell you that the ideal was to put this function that you created within the event of "onMouse" that is how the user put the mouse on top make the position adjustment, because sometimes the browser can only have the actual dimension of the elements after loading the elements as well as the user would only put the mouse once loaded, but looking fast you are using a library called "overlay" which is well compressed and I thought it would be a childbirth to open it.
Then I thought that the loading time was interfering at the time of it positioning the elements, and doing the debug I saw that its function was neither being called before nor after loading (at least in IE), then looking calmly I realized that using the function of Jquery .load, but in my view this function does not enter in its context, the 'load' function serves to load an HTML (or something else) of the server and put in the specified element, it would be like an inline Ajax request, but in your case the elements of your page are already loaded do not have what, nor where to pull, because it works only with Urls, so she was making a mistake and didn’t get to read the rest of the function.
Meaning I just took out this little piece and it worked IE 11, FF 44+ and Chrome 48+, at least in my quick tests now on Core (haha), so try replacing your current function with the clean version and try again:
$('.overlay img').each(function() {
var image;
image = $(this).parent().find('.centralize');
image.css('marginTop', (image.parent().height() - image.height()) / 2);
});
I think it would be better to have a css-formatted div so that everything inside is centered and use jQuery just to start the effect but not to center the content.
– helderk
To do this I would have to set a height for the Divs in css and unfortunately I can’t do that, which holds me to the JS to center the image cynically according to the size of the parent div... =/
– MateusDemboski
the problem then goes there. should separate the functions.
– helderk
one function to define the center of the div and another to start the animation.
– helderk
Note that in your example this does not happen, when the order to start the effect/animation the center of the div has already been defined. You should set this right when you upload the image.
– helderk