jquery-match-height icon indicating copy to clipboard operation
jquery-match-height copied to clipboard

iPad rotation

Open JWestarp opened this issue 10 years ago • 9 comments

I think the resize doesn't trigger if i rotate my iPad from landscape to portrait.

JWestarp avatar Feb 18 '15 10:02 JWestarp

@JWestarp same thing happening here using a Blackberry

cezarpopa avatar Feb 18 '15 15:02 cezarpopa

@JWestarp Same problem here - iPad Air - iOS 8

Lewitje avatar Mar 20 '15 13:03 Lewitje

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.

liabru avatar Mar 21 '15 12:03 liabru

The problem seems to be still there... any chances for update?

ArmorDarks avatar Jun 18 '15 06:06 ArmorDarks

@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 avatar Nov 19 '15 22:11 zanderi

@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?!

JWestarp avatar Nov 24 '15 15:11 JWestarp

Edit: Does the slash at the end do anything?!

It's mandatory for XHTML. For HTML5 it's better to drop it.

ArmorDarks avatar Nov 24 '15 15:11 ArmorDarks

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(); });

B1nk1e avatar Nov 08 '17 09:11 B1nk1e

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);

}

lxgiang90 avatar Feb 08 '22 04:02 lxgiang90