Revision history [back]

click to hide/show revision 1
initial version

answered 2015-03-31 03:58:10 +0800

vincentjian gravatar image vincentjian

This may happened when browser zooms in/out and then the screen width/height become double value. You can override the javascript to parse the value to integer before sending the client info event.

<script defer="true"><![CDATA[
var _portrait = {'0': true, '180': true}, //default portrait definition
    _initLandscape = jq.innerWidth() > jq.innerHeight(), // initial orientation is landscape or not
    _initDefault = _portrait[window.orientation]; //default orientation

zAu.cmd0.clientInfo = function(dtid) {
    zAu._cInfoReg = true;
    var orient = '',
        dpr = 1;

    if (zk.mobile) {
        //change default portrait definition because landscape is the default orientation for this device/browser.
        if ((_initLandscape && _initDefault) || (!_initLandscape && !_initDefault))
            _portrait = {'-90': true, '90': true};

        orient = _portrait[window.orientation] ? 'portrait' : 'landscape';
    } else {
        orient = jq.innerWidth() > jq.innerHeight() ? 'landscape' : 'portrait';
    }

    if (window.devicePixelRatio)
        dpr = window.devicePixelRatio;

    zAu.send(new zk.Event(zk.Desktop.$(dtid), 'onClientInfo', 
        [new Date().getTimezoneOffset(),
        zk.parseInt(screen.width), zk.parseInt(screen.height), screen.colorDepth,
        zk.parseInt(jq.innerWidth()), zk.parseInt(jq.innerHeight()), zk.parseInt(jq.innerX()), zk.parseInt(jq.innerY()), dpr.toFixed(1), orient],
        {implicit:true, rtags: {onClientInfo: 1}}));
}
]]></script>

This may happened when browser zooms in/out in mobile device and then the screen width/height become double value. You can override the javascript to parse the value to integer before sending the client info event.

<script defer="true"><![CDATA[
var _portrait = {'0': true, '180': true}, //default portrait definition
    _initLandscape = jq.innerWidth() > jq.innerHeight(), // initial orientation is landscape or not
    _initDefault = _portrait[window.orientation]; //default orientation

zAu.cmd0.clientInfo = function(dtid) {
    zAu._cInfoReg = true;
    var orient = '',
        dpr = 1;

    if (zk.mobile) {
        //change default portrait definition because landscape is the default orientation for this device/browser.
        if ((_initLandscape && _initDefault) || (!_initLandscape && !_initDefault))
            _portrait = {'-90': true, '90': true};

        orient = _portrait[window.orientation] ? 'portrait' : 'landscape';
    } else {
        orient = jq.innerWidth() > jq.innerHeight() ? 'landscape' : 'portrait';
    }

    if (window.devicePixelRatio)
        dpr = window.devicePixelRatio;

    zAu.send(new zk.Event(zk.Desktop.$(dtid), 'onClientInfo', 
        [new Date().getTimezoneOffset(),
        zk.parseInt(screen.width), zk.parseInt(screen.height), screen.colorDepth,
        zk.parseInt(jq.innerWidth()), zk.parseInt(jq.innerHeight()), zk.parseInt(jq.innerX()), zk.parseInt(jq.innerY()), dpr.toFixed(1), orient],
        {implicit:true, rtags: {onClientInfo: 1}}));
}
]]></script>

This may happened happen when browser zooms in/out in mobile device and then the screen width/height become double value. You can override the javascript to parse the value to integer before sending the client info event.

<script defer="true"><![CDATA[
var _portrait = {'0': true, '180': true}, //default portrait definition
    _initLandscape = jq.innerWidth() > jq.innerHeight(), // initial orientation is landscape or not
    _initDefault = _portrait[window.orientation]; //default orientation

zAu.cmd0.clientInfo = function(dtid) {
    zAu._cInfoReg = true;
    var orient = '',
        dpr = 1;

    if (zk.mobile) {
        //change default portrait definition because landscape is the default orientation for this device/browser.
        if ((_initLandscape && _initDefault) || (!_initLandscape && !_initDefault))
            _portrait = {'-90': true, '90': true};

        orient = _portrait[window.orientation] ? 'portrait' : 'landscape';
    } else {
        orient = jq.innerWidth() > jq.innerHeight() ? 'landscape' : 'portrait';
    }

    if (window.devicePixelRatio)
        dpr = window.devicePixelRatio;

    zAu.send(new zk.Event(zk.Desktop.$(dtid), 'onClientInfo', 
        [new Date().getTimezoneOffset(),
        zk.parseInt(screen.width), zk.parseInt(screen.height), screen.colorDepth,
        zk.parseInt(jq.innerWidth()), zk.parseInt(jq.innerHeight()), zk.parseInt(jq.innerX()), zk.parseInt(jq.innerY()), dpr.toFixed(1), orient],
        {implicit:true, rtags: {onClientInfo: 1}}));
}
]]></script>
Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More