-
staticResponsiville.Main.autoRun(){void}
-
Automatically initialises the Responsiville framework. It is dependendent on
the fact that the jQuery and the main Responsiville scripts (not the modules)
have loaded. It is activated via the global RESPONSIVILLE_AUTO_INIT and it
uses the global RESPONSIVILLE_DEBUG.
Returns:
-
-
Get the singleton responsiville instance. Oh, did we mention? Responsiville
is a singleton, because in a browser you only get one responsive web page at
a time.
Returns:
Type |
Description |
Responsiville.Main
|
The singleton Responsiville object instance
which is responsible for the current page. |
-
-
Window resize event handler which takes care of manipulating the breakpoints,
setting and unsetting them accordingly.
Fires:
Returns:
-
calculateCurrentBreakpoint(){Object}
-
Calculate the current breakpoint according to the current browser window
size.
Returns:
Type |
Description |
Object
|
The current breakpoint. |
-
-
Calculates and caches internally the current viewport dimensions.
Returns:
void
-
compareTo(testBreakpointName){boolean}
-
Compares a given breakpoint to the current breakpoint in order to determnine
which one is bigger or if they are equal. Note that the comparison refers to
the general breakpoint notion and not actual dimensions in pixels.
Name |
Type |
Description |
testBreakpointName |
string
|
The breakpoint name against which to
check. |
Returns:
Type |
Description |
boolean
|
A positive number if the given breakpoint is bigger than
the current breakpoint, a negative number if it is smaller
and zero if they are equal. |
-
deregisterBreakpoint(breakpointName){void}
-
Deregisters an existing breakpoint.
Name |
Type |
Description |
breakpointName |
string
|
The code name of the breakpoint to deregister. |
Returns:
-
getProperty(name){Object}
-
Gets a property from the browser local storage.
Name |
Type |
Description |
name |
string
|
The key name of the property to retrieve from the
browser local storage. |
Returns:
Type |
Description |
Object
|
The value that corresponds to the given property from the
browser local storage. |
-
-
Checks whether the last breakpoint change was towards a bigger screen.
Returns:
Type |
Description |
boolean
|
Whether the last breakpoint change was towards a bigger
screen. |
-
-
Initilalises the responsive magic. Sets up the necessary event handlers on
browser window resize that assist in controlling the desired responsive
behaviour. Runs exactly once.
Returns:
-
is(breakpointNames){boolean}
-
Checks whether the current browser window size is currently at the given
breakpoint(s). Useful in order to check if we are inside the range of a
specific breakpoint.
Name |
Type |
Description |
breakpointNames |
Array.<string>
|
string
|
The breakpoint name(s) against
which to check. Can be just a
single breakpoint name or a
comma separated list of
breakpoint names or an array of
breakpoint names. |
Returns:
Type |
Description |
boolean
|
Whether the browser window is at the given breakpoint(s). |
-
isBiggerThan(testBreakpointName){boolean}
-
Checks whether the current window is at a breakpoint bigger than the given
breakpoint.
Name |
Type |
Description |
testBreakpointName |
string
|
The breakpoint name against which to
check. |
Returns:
Type |
Description |
boolean
|
Whether the browser window is at a breakpoint bigger than
the given one. |
-
-
Checks whether the current device is a mobile and not a desktop one based on
the user agent of the browser.
Returns:
Type |
Description |
boolean
|
Whether the current device is a mobile one. |
-
isEqualOrBiggerThan(testBreakpointName){boolean}
-
Checks whether the current window is at a size equal or bigger than the given
breakpoint.
Name |
Type |
Description |
testBreakpointName |
string
|
The breakpoint name against which to
check. |
Returns:
Type |
Description |
boolean
|
Whether the browser window is at a breakpoint bigger or
equal to the given one. |
-
isEqualOrSmallerThan(testBreakpointName){boolean}
-
Checks whether the current window is at a breakpoint equal or smaller than
the given breakpoint.
Name |
Type |
Description |
testBreakpointName |
string
|
The breakpoint name against which to
check. |
Returns:
Type |
Description |
boolean
|
Whether the browser window is at a breakpoint smaller or
equal to the given one. |
-
-
Checks whether the current screen has a high devide pixel ratio, that is
greater than 1 (HiDPI, retina, etc).
Returns:
Type |
Description |
boolean
|
Whether the current screen has a high device pixel ratio. |
-
isSmallerThan(testBreakpointName){boolean}
-
Checks whether the current window is at a breakpoint smaller than the given
breakpoint. Remember that we are checking mobile first.
Name |
Type |
Description |
testBreakpointName |
string
|
The breakpoint name against which to
check. |
Returns:
Type |
Description |
boolean
|
Whether the browser window is at a smaller breakpoint than
the given one. |
-
-
Prints the current registered breakpoints in the browser console.
Returns:
-
registerBreakpoint(breakpointName, breakpointWidth){void}
-
Registers a new, non-default, breakpoint in the system.
Name |
Type |
Description |
breakpointName |
string
|
The code name of the new breakpoint. |
breakpointWidth |
int
|
The window width of the new breakpoint. |
Returns:
-
runBreakpointChangeCallbacks(){void}
-
Runs all callbacks registered on breakpoint change events (either entering or
leaving a breakpoint).
Returns:
-
setProperty(name, value){void}
-
Sets a property in the browser local storage.
Name |
Type |
Description |
name |
string
|
The key name of the property to set in the browser
local storage. |
value |
Object
|
The value that is to be set for the given property code
name in the browser local storage. |
Returns:
-
-
Runs all the function callbacks which are attached to the Responsiville Main
object's resize event. The call to this function has been registered as
throttled to begin with, so that the browser is protected from repeated calls
of the same callbacks.
Fires:
Returns:
void