I have a full page slideshow using jQuery(window).height() and it works fine on most browsers, however I checked it out on my phone (Android Browser & Dolphin) and the slideshow just keeps growing endlessly, well beyond the height of the view-port. This is my code:
var height = jQuery(window).height();
jQuery('.slide').each(function(index, element) {
if(height > 600) jQuery(this).height(height);
else jQuery(this).height(600);
});
jQuery(window).on('resize orientationChanged', function() {
jQuery('.slide').each(function(index, element) {
if(height > 600) jQuery(this).height(height);
else jQuery(this).height(600);
});
});
Any ideas what could be causing it?
Thanks.
so after 3 year of this question asked jquery window height still not working in mobile devices just replace jquery with javascript and it worked for me.
replace jquery
var bodyh = jQuery("body").height();
var windowh = jQuery(window).height();
with javascript
var bodyh = document.body.clientHeight;
var windowh = window.innerHeight;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With