Class: Responsive

Responsive


new Responsive()

Constructor is PRIVATE, client must use only class methods!!!!!

Source:

Members


<static, constant> version :String

Library version

Type:
  • String
Source:

Methods


emit(type, arguments)

Emit event, can be used for emitting custom events too, just register them via JS.Responsive.on method.

Parameters:
NameTypeArgumentDescription
typeString

type of an event callback will be registered to

arguments*<repeatable>

used when calling callbacks

Source:
Returns:

JS.Responsive - for chaining

Type:
Object

init( [config])

Initialise JS.Responsive

Parameters:
NameTypeArgumentDescription
configObject<optional>

Object with key value pairs of features which will be initialised, if notprovided, all features will be initialised. If you provide empty object, none of features will be initialised.

Source:

is(classNames)

Tests if HTML element contains given class names.

Parameters:
NameTypeArgumentDescription
classNamesString<repeatable>

class names

Source:
Returns:
Type:
Boolean
Examples
JS.Responsive.is('mobile') === true, when HTML contains "mobile" class
JS.Responsive.is('portrait touch') === true, when HTML contains "portrait" and "touch" class
JS.Responsive.is('portrait touch', 'mobile') === true, when HTML contains ("portrait" and "touch" class) OR ('mobile')

off(type, fn)

Unregister callback of referenced event type

Parameters:
NameTypeDescription
typeString

type of an event callback where callback is registered

fnfunction

callback function to be unregistered

Source:
Returns:

JS.Responsive - for chaining

Type:
Object

on(type, fn)

Register callback to referenced event type

Parameters:
NameTypeDescription
typeString

type of an event callback will be registered to

fnfunction

callback function called after event occurred

Source:
Returns:

JS.Responsive - for chaining

Type:
Object