Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Empower web sites and apps design through clever CSS selectors. Check a working sample at

License

NotificationsYou must be signed in to change notification settings

rogeriotaques/detectr.js

Repository files navigation

Latest Version

Empower web sites and apps design through clever CSS selectors.

This plugin is a very small javascript library which gives you the ability towrite clever and specific CSS rules to refine your website design for eachdifferent browser, platform, device and operating system.

It has a really small footprint and doesn't have any library dependencies such as: jQuery, Mootools, (...). So,you can use it alone, or combined with those packages.

Get started

1. Get the source code or install it vianpm

Start by cloning this repository to your local machine, or just download thesource-code into any folder of your PC. As an open-source, the source-code isavailable in its natural format and minified.

or simply run this command in your terminal

$ npm install -S detectr.js

2. Copy necessary files

Import or copy thedist/detectr.js (minified) file to any directory of your websiteor app. For example:

/ (root)|-- img/|-- css/|-- js/|    |-- detectr.js|-- index.html

3. Import the library

Import the library in your HTML files.

Since it is intended to help you create better designs by empower your controlon CSS rules according to used browsers, I strongly recommend you to importDetectr.js within the HEAD tags.

E.g:

<html >  <head >    ...    <script type="text/javascript" src="js/detectr.js" ></script>  </head>  <body >    ...  </body></html>

4. Done.

As simple as that. As soon as you complete the 3 steps above and refresh yoursite in any browser, you will be able to see that many specific classes nameswere added in the HTML tag of your page.

E.g:

<html >  ...</html>

Available CSS classes

Detectr.js may add the following classes in the HTML tag:

Browsers

ClassRemark
.edgeMicrosoft Edge
.ieInternet Explorer
.ie{version}E.g. ie10.
.webkitBrowsers based on the webkit
.ironIron Web Browser
.chromeGoogle Chrome
.chrome{version}E.g. chrome23
.firefoxFirefox Browser
.firefox{version}E.g. firefox32
.operaOpera Browser
.opera{version}E.g. opera16
.konquerorKonqueror Browser
.safariSafari Browser
.safari{version}E.g. safari12
.geckoBrowsers based on gecko
.android-browserAndroid native browsers

Operating Systems

ClassRemark
.macApple Macintosh
.osx{version}E.g. osx10_10
.ios{version}E.g. ios8
.windowsMicrosoft Windows
.win2kMicrosoft Windows 2000
.win2k.sp1Microsoft Windows 2000 SP1
.xpMicrosoft Windows XP
.vistaMicrosoft Windows Vista
.win7Microsoft Windows 7
.win8Microsoft Windows 8
.win8_1Microsoft Windows 8.1
.win10Microsoft Windows 10
.ntMicrosoft Windows NT
.nt{version}E.g. nt6.1
.webtvWeb TV
.freebsdFreebsd
.linuxLinux
.androidAndroid
.bb{version}E.g. bb10 (for Blackberry 10)

Platform

ClassRemark
.x32Platform 32 bits
.x64Platform 64 bits
.armPlatform ARM

Devices

ClassRemark
.j2me
.iphoneApple iPhone
.ipadApple iPad
.ipodApple iPod
.mobileAny mobile device
.blackberryBlackberry

Other

ClassRemark
.touchTouch screen devices
.jsJavascript supported
.svgSVG Images supported
.no-svgSVG Images NOT supported
.retinaDevices with pixelratio > 1
.no-retinaDevices with pixelration = 1
.portraitPortrait orientation
.landscapeLandscape orientation

Inspiration

This project is based on Rafael Lima's library "css_browser_selector"(http://rafael.adm.br/css_browser_selector/) which seems to be discontinuedsince Nov 2nd, 2010.

License

This projec is licensed under MIT License.

Copyright (c) 2015-2019 Rogério Taques

Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

About

Empower web sites and apps design through clever CSS selectors. Check a working sample at

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp