B4J Question ABMaterial - locking orientation


Well-Known Member
Licensed User
Longtime User
In my continued exploration of ABMaterial I would like to work out how to lock browser orientation.

Only clue I have found so far is:


by alwaysbusy/Alain which I reproduce below:

@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation:portrait) {

  body {

-webkit-transform: rotate(90deg);

width: 100%;

height: 100%;

   overflow: hidden;

   position: absolute;

top: 0;

left: 0;



$(document).ready(function () {

  function reorient(e) {

var portrait = (window.orientation % 180 == 0);

$("body").css("-webkit-transform", !portrait ? "rotate(-90deg)" : "");


  window.onorientationchange = reorient;

window.setTimeout(reorient, 0);


Trouble is after a couple of hours messing around I can't for the life of me work out how I could insert this in the ABMMini project.

Any pointers would be greatly appreciated.