Skip to content

aeliusdev/WebVC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebVC

A JavaScript class for checking browser & mobile compatibility.

Features

  • Browser Info
  • Detect the current browser name. For example Chrome.
  • Detect the current browser version to no decimal places. For example Chrome 10.
  • Detect the current latest browser version. For example Chrome 10.0.167.
  • Detect the current application name. For example Netscape.
  • Detect current orientation of the browser window.
  • Mobile Detection
  • Detect whether the current browser is a mobile browser.
  • Detect a change in orientation and provide a callback function. For example when some one rotates their iPhone into portrait view you can create a callback telling them to rotate into landscape.

Usage

Browser Information

The WebVC.browser(); method allows you get current browser information.

  • Browser Name: WebVC.browser().name
  • Browser Major Version: WebVC.browser().version
  • Browser Current Version: WebVC.browser().version_accurate
  • Browser Application Name: WebVC.browser().app_name

Detecting a Mobile Browser

Use WebVC.is_mobile() to detect mobile browsers.

if ( WebVC.is_mobile() ) 
{
  
  alert( "Mobile Browser Present!" );

}

Detecting Orientation

Use WebVC.orientation() to detect the current orientation.

alert( WebVC.orientation() );

Detecting Mobile Orientation & Changes in Orientation

Use WebVC.mobile_orientation() to detect the current orientation.

alert( WebVC.mobile_orientation() );

Use WebVC.mobile_orientation_change( function_name ) to detect a change in orientation.

Parameters: function_name - The name of the callback function when a change of orientation has been detected.

function alertCurrentOrientation () 
{
  
  alert( WebVC.mobile_orientation() );

}

WebVC.mobile_orientation_change( alertCurrentOrientation );

Thanks for reading!

About

A JavaScript class for checking browser & mobile compatibility.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published