js/OverlayScrollbars.js
function(event) {
                event = event.originalEvent || event;

                var strPage = 'page';
                var strClient = 'client';
                var strX = 'X';
                var strY = 'Y';
                var target = event.target || event.srcElement || document;
                var eventDoc = target.ownerDocument || document;
                var doc = eventDoc.documentElement;
                var body = eventDoc.body;

                //if touch event return return pageX/Y of it
                if(event.touches !== undefined) {
                    var touch = event.touches[0];
                    return {
                        x : touch[strPage + strX],
                        y : touch[strPage + strY]
                    }
                }

                // Calculate pageX/Y if not native supported
                if (!event[strPage + strX] && event[strClient + strX] && event[strClient + strX] != null) {

                    return {
                        x : event[strClient + strX] +
                        (doc && doc.scrollLeft || body && body.scrollLeft || 0) -
                        (doc && doc.clientLeft || body && body.clientLeft || 0),
                        y : event[strClient + strY] +
                        (doc && doc.scrollTop || body && body.scrollTop || 0) -
                        (doc && doc.clientTop || body && body.clientTop || 0)
                    }
                }
                return {
                    x : event[strPage + strX],
                    y : event[strPage + strY]
                };
            }
function(event) {
                event = event.originalEvent || event;

                var strPage = 'page';
                var strClient = 'client';
                var strX = 'X';
                var strY = 'Y';
                var target = event.target || event.srcElement || document;
                var eventDoc = target.ownerDocument || document;
                var doc = eventDoc.documentElement;
                var body = eventDoc.body;

                //if touch event return return pageX/Y of it
                if(event.touches !== undefined) {
                    var touch = event.touches[0];
                    return {
                        x : touch[strPage + strX],
                        y : touch[strPage + strY]
                    }
                }

                // Calculate pageX/Y if not native supported
                if (!event[strPage + strX] && event[strClient + strX] && event[strClient + strX] != null) {

                    return {
                        x : event[strClient + strX] +
                        (doc && doc.scrollLeft || body && body.scrollLeft || 0) -
                        (doc && doc.clientLeft || body && body.clientLeft || 0),
                        y : event[strClient + strY] +
                        (doc && doc.scrollTop || body && body.scrollTop || 0) -
                        (doc && doc.clientTop || body && body.clientTop || 0)
                    }
                }
                return {
                    x : event[strPage + strX],
                    y : event[strPage + strY]
                };
            }
function ( event ) { event = event . originalEvent || event ; var strPage = 'page' ; var strClient = 'client' ; var strX = 'X' ; var strY = 'Y' ; var target = event . target || event . srcElement || document ; var eventDoc = target . ownerDocument || document ; var doc = eventDoc . documentElement ; var body = eventDoc . body ; //if touch event return return pageX/Y of it if ( event . touches !== undefined ) { var touch = event . touches [ 0 ] ; return { x : touch [ strPage + strX ] , y : touch [ strPage + strY ] } } // Calculate pageX/Y if not native supported if ( ! event [ strPage + strX ] && event [ strClient + strX ] && event [ strClient + strX ] != null ) { return { x : event [ strClient + strX ] + ( doc && doc . scrollLeft || body && body . scrollLeft || 0 ) - ( doc && doc . clientLeft || body && body . clientLeft || 0 ) , y : event [ strClient + strY ] + ( doc && doc . scrollTop || body && body . scrollTop || 0 ) - ( doc && doc . clientTop || body && body . clientTop || 0 ) } } return { x : event [ strPage + strX ] , y : event [ strPage + strY ] } ; }
Gets the pageX and pageY values of the given mouse event.
@param event The mouse event of which the pageX and pageX shall be got.
@returns {{x: number, y: number}} x = pageX value, y = pageY value.
Gets the pageX and pageY values of the given mouse event .