Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vebersol/idetector
A javascript to detect apple devices like iPhone, iPod and iPad and apply a different style for each device, if needed.
https://github.com/vebersol/idetector
Last synced: about 2 months ago
JSON representation
A javascript to detect apple devices like iPhone, iPod and iPad and apply a different style for each device, if needed.
- Host: GitHub
- URL: https://github.com/vebersol/idetector
- Owner: vebersol
- Created: 2010-07-01T19:41:14.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-04-26T12:55:14.000Z (over 13 years ago)
- Last Synced: 2024-10-15T15:43:14.309Z (3 months ago)
- Language: JavaScript
- Homepage: http://vebersol.net
- Size: 97.7 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkdn
Awesome Lists containing this project
README
# Allowed Options:
* verticalStyles: an Object that contain each allowed device name and an Array with all css required for this device on vertical position.
* horizontalStyles: an Object that contain each allowed device name and an Array with all css required for this device on vertical position.
* standardStyles: an Array with all css required for not allowed devices, like common browsers.
* cssPath: an string with correct path to css.
* allowedDevices: an Array with allowed devices.
* linksClassName: a class name for all css added dinamically.# Example:
var options = {
verticalStyles: {
ipad: ['ipad.css'],
iphone: ['iphone.css'],
ipod: ['ipod.css']
},
horizontalStyles: {
ipad: ['hor_ipad.css'],
iphone: ['hor_iphone.css'],
ipod: ['hor_ipod.css']
},
standardStyles: ['common.css'],
cssPath: '../_css/',
allowedDevices: ['ipad', 'ipod', 'iphone'],
linksClassName: 'iDetector'
}var detector = new iDetector(options);
# Methods:
* getAgent(); //return a string that contain your user agent
* getDeviceName(); //name of your device
* getOrientation(); //get orientation of your deviceName
* detectAgent(); //detect if this device is an allowed device
* defineStyles(); //apply all defined styles in your options
* addRotationEvent(); //apply rotation event for applications that need 1 css for each position (vertical, horizontal)
* removeLinkTags(); // remove all css added dinamically