New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

device-orientation

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

device-orientation

A Web Components for detecting device orientation..

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

<device-orientation>

A Web Components for detecting device orientation. Can be used with or without Polymer. Usage is exactly the same.

npm i --save device-orientation

<device-orientation></device-orientation>

Example

<!-- For Vanilla with no modules -->
<script src="device-orientation.js"></script>

<device-orientation id="orientationEl"></device-orientation>

<p>Left Right: <span id="lr">0</span></p>
<p>Left Right: <span id="fb">0</span></p>
<p>Left Right: <span id="direction">0</span></p>

<script>
    var el = document.getElementById('orientationEl');
    var lr = document.getElementById('lr');
    var fb = document.getElementById('fb');
    var direction = document.getElementById('direction');

    el.orientationChanged = function () {
        lr.innerText = el.lr;
        fb.innerText = el.fb;
        direction.innerText = el.direction;
    };
</script>

properties

lr

Type: Number

left to right value

fb

Type: Number

front to back value

direction

Type: number

direction value

Keywords

device

FAQs

Package last updated on 02 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts