This is a (temporary fix) for visual composer messing up heights of grid elements on iPads.
Basically, visualcomposer just parses the device width and height very sloppy.
this results in a height property like this:
element {
height: 314x301;
}
which is of course wrong.
This code is a fix for that.
It first waits until the visual composer element exists, and the extracts the height and fixes it.
if (navigator.userAgent.match(/iPad/i) != null){
var element = ".vc_custom_1234567890000"; //change this here
var checkExist = setInterval(function(){
if ($(element).length){
clearInterval(checkExist);
var height = $(element).attr("style").split('height:').pop().split(';').shift();
var fixed = height.substr(height.indexOf("x") + 1);
$(element).attr("style", "height:" + fixed + "px !important;");
}
}, 100);
}
Additionally, if the text inside the VC Element is too big, it can be optimized using this JS code:
var textsel = ".vc_gitem-zone-mini .vc_gitem-row-position-bottom .vc_custom_heading h3";
$(textsel).addClass("ipad--fix");
inside
var checkExist = setInterval(function() { /* ... */ }, 100);
with those CSS rule:
.ipad--fix { font-size: 17px !important; /* or any other value */ }