jquery-match-height
jquery-match-height copied to clipboard
iPad rotation
I think the resize doesn't trigger if i rotate my iPad from landscape to portrait.
@JWestarp same thing happening here using a Blackberry
@JWestarp Same problem here - iPad Air - iOS 8
Thanks guys I'll check this out.
I was under the impression that the orientationchange event had it covered, there must be something else going on.
The problem seems to be still there... any chances for update?
@ArmorDarks , @Lewitje, @lemonthirst, @JWestarp Just curious but what are you declaring for your viewport tag? If you're not already I would recommend using the html5 boiler plate viewport tag
<meta name="viewport" content="width=device-width, initial-scale=1">
The key here being the initial-scale=1
See this article here: http://www.quirksmode.org/blog/archives/2013/10/initialscale1_m.html
@zanderi Hey, I'm using the same viewport tag as you mentioned:
<meta name="viewport" content="width=device-width, initial-scale=1" />
Edit: Does the slash at the end do anything?!
Edit: Does the slash at the end do anything?!
It's mandatory for XHTML. For HTML5 it's better to drop it.
I've added this into my own .js file and fixed the issue. It looks like that orientationchange event is not always triggered.
$(window).bind('resize orientationchange', function(event) { $('.match-height').matchHeight(); });
I used like this, and it works fine when rotating in the browser. Many thanks
jQuery(document).ready(function(){
onChangeHeight();
});
jQuery(window).bind('resize orientationchange', function(event) {
onChangeHeight();
});
function onChangeHeight() {
jQuery('.match-height').removeAttr('style');
setTimeout(function() {
jQuery(".match-height").matchHeight();
}, 300);
}