-
Notifications
You must be signed in to change notification settings - Fork 93
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
Centering not picked up #5
Comments
Hi, |
Sure. I have updated the page to load the development version. The error occurs on line 308, at $(window).on as far as I can see. |
This error is due to the fact that you're using an old version of jQuery. That doesn't explain why your images aren't centered. I'm still |
Are you initializing your element with a background size? |
I believe I am. There's both javascript code that adds the css directly to the element as well as a rule for the class that contains "background-size: cover": from http://beta.insachenkunst.de/wordpress/wp-content/themes/insachenkunst/js/artist-gallery.js line 10: element.style {
background-image: url("http://beta.insachenkunst.de/wordpress/wp-content/uploads/Schulhauser-4-Postpanoptisches-Lächeln-4-mittel.jpg");
background-position: center center;
background-repeat: no-repeat;
background-size: contain;
} and http://beta.insachenkunst.de/wordpress/wp-content/themes/insachenkunst/page-kuenstler-einzelansicht.css line 19 .gallery .gallery-large-thumb {
background-position: center center;
background-size: contain;
border: medium none;
display: block;
height: 339px;
margin-bottom: 13px;
width: 552px;
} |
Just an update: jQuery was previously loaded as version 1.4.4 from Google CDN, causing unmet requirements. I have just updated jQuery to version 1.8.1, but I am still getting the $(window).on error from IE8. |
Hey Louis, any chance that you can look at the issue? The I can see that elements created by jQuery, and they all seem to have the correct size, but since the image is positioned absolute and You could probably identify and rectify the cause with a glance. Would you mind taking a look at this again? |
I just ran into this same issue myself. It's being caused by a naughty
Remove that on the elements that you want to use the script on and you should be golden. |
Unfortunately, it did not work for me. I have disabled the Neither
nor
helped. Anything else I could try? |
I have the same problem, on some window sizes its perfect, but sometimes the image is not centered, sometimes it's even completely outside of the viewing area. Anyone found a solution to this? I don't have max-width anywhere in my CSS, so that didn't solve my problem :( |
@tliebig if you have a test page up where you're experiencing the issue, I can have a quick look. |
Yes, sure. Right here: |
Aaahhh, I see you're using |
tliebig - I think this is a jQuery version issue. I too was using 1.8.1, and was having problems with centre alignment in IE8 after resize. I changed my jQuery version to 1.7.0 and hey presto, it's fixed. So may be give that a try if you're still looking for a solution. Ultimately, it appears that there is something in the new version of jQuery that is causing this issue. |
I'd love to have a confirmation of the solution proposed by @cabdesigns |
@louisremi I'm not exactly sure where the issue lies, but I know that by reverting my jQuery version it appears to have resolved the problem. I'll try dig deeper and see if I can pin point exactly what the actual problem is; I'll report back if I can find out any more information. |
Sorry - just reverted to jQuery 1.7.2 and it's still not centering: http://www.insachenkunst.de/kuenstler/tom-schulhauser/. If there's any other stuff i can try out for you to zero in on the problem, I'll be more than glad to help you out! |
@tliebig - @cabdesigns said he reverted to 1.7.0, did you try going down that far? |
Going to to 1.7.0 results in the following error for IE8: Unable to get property 'width' of undefined or null reference
jQuery.backgroundSize.js, line 184 character 3 Maybe someone more JS-profilic than me can interpret that error? |
@tliebig I think this problem occurs when a background image is unreachable (you have an error in the URL). I don't have time to fix the different problem with this script because I'm working on an IE behavior (.htc) that doesn't depend on jQuery and can be activated using CSS only. I hope to have it ready for beta-testing today and I could use some help from all of you. |
Alright, the update to jquery.backgroundSize.js is coming: background-size-polyfill is now in public alpha! I'll only have time to write a proper README next week, but the instructions are rather simple: once you have uploaded the appropriate files on your server, when you write I've put together a small demo here: http://louisremi.github.com/background-size-polyfill/ The major regression compared to jquery.backgroundSize.js is that IE6 and IE7 aren't supported. Adding support for those browsers should be relatively straightforward, I'm simply not willing to put any efforts into it. Thanks for your patience and help. |
Hey Louis,
great to see someone taking care of IEs lacking support for some of CSS' more helpful options. I'm employing the script here:
http://beta.insachenkunst.de/kuenstler/tom-schulhauser/
and although it resizes the image fine, it fails to correctly center the image. Any idea as to why that might happen?
The text was updated successfully, but these errors were encountered: