# display **Repository Path**: mirrors_WebReflection/display ## Basic Information - **Project Name**: display - **Description**: a simple cross browser way to obtain some display info - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-19 - **Last Updated**: 2026-07-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README display ======= [![build status](https://secure.travis-ci.org/WebReflection/display.png)](http://travis-ci.org/WebReflection/display) a very simple object with some display info version **alpha** ### API * `.width:Number` the current device width in pixels * `.height:Number` the current device height in pixels * `.ratio:Number` the current device ratio (1 === 100%) * `.on(type, callback)` a basic mechanism to add a listener. Right now accepts only `change` type That's pretty much it for now. The change event should be fired only if something really change on the screen. Most likely this will fire on browsers window resizes or devices orientation change. ```javascript display.on('change', function (width, height) { alert('new size! ' + [width, height]); }); alert('current size: ' + [display.width, display.height]); ``` This API is very simple right now on purpose. I need to understand when/why/where it needs to be improved, specially on mobile.