-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clearing Bug: image shifts to bottom #3410
Comments
Having the same issue.. usually only on the first opening of the Clearing image.. then Left or Right arrows reset the image to center. After a little inspection it looks like the JS applied inline margins are incorrect on that image. eg. when I view generated source, I can see that the inline styling applied to the image is:
However, when I view that same image, after it has been properly aligned in the center (either by clicking a Left/Right arrow, etc.) I can see the that the inline style (the correct one) is:
So the calculation of the margin offsets are where things are going wrong |
This is happening consistently in Safari 7.0.1 on the doc page for clearing: http://foundation.zurb.com/docs/components/clearing.html |
I can confirm this happening in Firefox 27 on Foundation doc page and also in my own projects. JS injected styles are wrongly calculated (margin-left: -0.5px; margin-top: -0.5px;) as @revivemarketing posted. There is also a forum thread http://foundation.zurb.com/forum/posts/1720-clearing--first-image-not-center with no solution. |
Dirtiest fix I ever wrote was for this issue: $(function(){
var runtime = 1000;
var interval = 100;
var timer = null;
resize = function(){
timer = setInterval("Foundation.libs.clearing.resize()", interval);
}
setTimer = function(){
setTimeout("clearTimer", runtime);
}
clearTimer = function(){
window.clearInterval(timer);
}
$('.clearing-thumbs li a').on('click', function(){
resize();
setTimer();
});
}); |
To replicate |
I have the same issue with Foundation 5 in Firefox on Mac and Windows. Didn't happen in version 4. |
This is an issue with |
Possibly fixed by 52599b3? |
@thedeerchild The bug is not resolved. Could you reopen this issue? |
I think this is something to do how browsers render CSS. W3 says, "Negative values for margin properties are allowed, but there may be implementation-specific limits." This is something to do when the image loads and when the CSS properties is added to the image. It's very rare bug since 5.3, it's hard to replicate it. |
Hey @tikot. This bug is not hard to replicate for me. I have got this issue constantly with Firefox 31.0 and Foundation 5.4.3. I´ve got no extra styling applied to clearing. Just Foundation styles only and the bug happens every first time i open clearing. |
Agree with @Baedda, this is still present in 5.4.7 and definitely seems the problem that the top and left margins are calculated too soon, against a 1 x 1px image (resulting in the Any window resize triggers a recalculation and fixes the centering. Are we able to swap this calculation out and just rely on a css vertical/horizontal centering technique, seeing as Foundation 5 doesn't support IE8 anyway? |
@oller: Tripple 👍 on the last one!!! |
Okay, it looks like I should fix this issue. Holidays are coming I will have some free time to look for a solution. |
@rafibomb will there be a push to bower-foundation so we can have a benefit from tikots fix, too? |
+1 I've tried to make same changes to files but ended up with Chrome having same bug like FF did earlier - just the image went to opposite corner. |
Sometimes this happens. I have looked into this to find what is the cause, but no luck yet. Maybe someone has an idea.
The text was updated successfully, but these errors were encountered: