Class: SimpleZoom

SimpleZoom

The class underlying the jQuery.fn.simpleZoom plugin.

new SimpleZoom()

Source:

Methods

destroy(removeEvents)→ {jQuery|SimpleZoom}

Destroys the plugin instance.
Parameters:
NameTypeArgumentDescription
removeEventsBoolean<optional>
If true then any plugin specified events bound to the target will be removed.
Source:
Returns:
Type
jQuery | SimpleZoom

disable()→ {jQuery|SimpleZoom}

Disables user interaction.
Source:
Returns:
Type
jQuery | SimpleZoom

enable()→ {jQuery|SimpleZoom}

Enable user interaction.
Source:
Returns:
Type
jQuery | SimpleZoom

getOverlay()→ {jQuery}

Get the element which is overlaid upon the plugin target in order to capture user events.
Source:
Returns:
Type
jQuery

getPosition()→ {SimpleZoom~position}

Get an object detailing the current position and positional constraints of the viewfinder.
Source:
Returns:
Type
SimpleZoom~position

getSimpleZoom()→ {SimpleZoom}

Get an object exposing all public methods of the plugin.
Source:
Returns:
Type
SimpleZoom

hide()→ {jQuery|SimpleZoom}

Hides the plugin viewfinder.
Source:
Returns:
Type
jQuery | SimpleZoom

isEnabled()→ {boolean}

Determine whether or not the plugin is enabled for user interaction.
Source:
Returns:
Type
boolean

isInitialized()→ {boolean}

Get the initialization state of the plugin. The plugin is not considered initialized until after the create event has occured.
Source:
Returns:
Type
boolean

isVisible()→ {boolean}

Get the visibility state of the viewfinder.
Source:
Returns:
Type
boolean

off(eventType, handler)→ {jQuery|SimpleZoom}

Unbind a handler to the specified event. See SimpleZoom#on for more information.
Parameters:
NameTypeDescription
eventTypestring
handlerfunction
Source:
Returns:
Type
jQuery | SimpleZoom

on(event, handler)→ {jQuery|SimpleZoom}

Bind a handler to the specified event.
Parameters:
NameTypeDescription
eventstringA single event or a whitespace separated list.
handlerfunction
Source:
Returns:
Type
jQuery | SimpleZoom

option(optionNameOrObject, value)→ {*}

This method is used to set or get plugin options.
  • If optionNameOrObject is not specified then a complete copy of the plugins options is returned.
  • If optionNameOrObject is a string and no value is specified then a copy of the specified option is returned.
  • If optionNameOrObject and value are both defined then the corresponding option is updated with the specified value.
  • If optionNameOrObject refers to an object property of SimpleZoom~options then that object is extended by the provided value.
Parameters:
NameTypeArgumentDescription
optionNameOrObjectObject | string<optional>
valueObject | string<optional>
Source:
Returns:
Type
*

refresh()→ {jQuery|SimpleZoom}

Updates the layout. This method should be invoked whenever the target changes position or is resized. By default a throttled version of this method is invoked whenever the browser window is resized.
Source:
Returns:
Type
jQuery | SimpleZoom

show()→ {jQuery|SimpleZoom}

Show the viewfinder.
Source:
Returns:
Type
jQuery | SimpleZoom

Type Definitions

options

Plugin options.
Type:
  • Object
Properties:
NameTypeArgumentDefaultDescription
afterHidefunction<optional>
nullA callback to be invoked after the viewfinder is hidden. Note that all options specified callbacks will be invoked with this set to be the plugin's target.
afterShowfunction<optional>
nullA callback to be invoked after the viewfinder is shown.
autoEnableboolean<optional>
trueDetermine whether or not SimpleZoom#enable is invoked upon initialization.
beforeDestroyfunction<optional>
nullA callback to be invoked before the plugin is destroyed.
beforeHidefunction<optional>
nullA callback to be invoked when the viewfinder hide animation begins.
beforeShowfunction<optional>
nullA callback to be invoked when the viewfinder show animation begins.
classNameObject<optional>
Properties
NameTypeArgumentDefaultDescription
overlaystring<optional>
"simplezoom-overlay"The CSS class to be assigned to the element which overlays the plugin target.
viewportstring<optional>
"simplezoom-viewport"The CSS class to be assigned to the designated viewport.
viewfinderstring<optional>
"simplezoom-viewfinder'The CSS class to be assigned to the viewfinder.
confineboolean<optional>
trueDetermines if the viewfinder should be confined to the boundary of the target.
enableScrollboolean<optional>
falseWhen enabled the plugin will track scroll events on the window and animate the viewfinder accordingly. This option will be automatically disabled if mobile is true or the target lies within a scrollable region which is not the window.
mobileboolean<optional>
falseEnable mobile support. Currently all functionality is supported except for nableScroll
onCreatefunction<optional>
nullA callback to be invoked once the plugin has completed initialization. Note that most plugin methods will throw an exception prior to this event occurring.
onDestroyfunction<optional>
nullA callback to be invoked once the plugin has been destroyed.
onLoadfunction<optional>
nullA callback to be invoked once the image resources associated with the plugin have been loaded.
onMoveStartfunction<optional>
nullA callback to be invoked when the user takes control of the viewfinder.
onMoveStopfunction<optional>
nullA callback to be invoked when the user cedes control of the viewfinder.
onRefreshfunction<optional>
nullA callback to be invoked every time the plugin's layout is recalculated.
smoothingnumber<optional>
0.35A value on the range 0 to 1, inclusive, which determines how smooth the viewfinder animation is. A value of 0 disables animation while 1 causes the viewfinder to remain stationary.
srcstring<optional>
nullThe URL of an image resource to be displayed within the plugins viewport.
viewfinderObject<optional>
* @property {Object} [viewfinder.hide]
Properties
NameTypeArgumentDefaultDescription
heightstring | number<optional>
Determines the height of the viewfinder when it is presented as a magnifying lens, e.g., no viewport has been specified.
hide.eventstring<optional>
'mouseout'The trigger event for the viewfinder's hide animation.
hide.durationnumber<optional>
100The duration of the viewfinder's hide animation in milliseconds.
showObject<optional>
Properties
NameTypeArgumentDefaultDescription
eventstring<optional>
'mouseover'The event upon which the viewfinder will be shown.
durationnumber<optional>
250The duration of the viewfinder's show animation in milliseconds.
move.eventstring<optional>
"mousemove"The event used to determine the position of the viewfinder. The event type must produce an event object with pageX and pageY properties.
moveStart.jumpToboolean<optional>
true'If true the viewfinder will jump to the users position when the viewfinder.moveStart.event event is triggered, else the viewfinder is animated to the users position from it's previous position.
moveStart.eventstring<optional>
"mouseover mousemove"The event which grants control of the viewfinder to the user. Once triggered the event will not be triggered until after a viewfinder.moveStop event has occurred.
moveStop.eventstring<optional>
"mouseout"The event upon which the user cedes control of the viewfinder.
widthstring | number<optional>
'33%'Analogous to viewfinder.height.
viewportstring | jQuery<optional>
Designates an element as the plugins active viewport. If a collection is specified then the first element is selected.
zoomnumber<optional>
nullA decimal representing the percent magnification level.
Source:

position

Type:
  • Object
Properties:
NameTypeDescription
topnumberDistance from the center of the viewfinder to the top of the targets content region.
leftnumberDistance from the center of the viewfinder to the left side of the targets content region.
minLeftnumberThe minimum value the left property.
maxLeftnumberThe maximum value of the left property.
minTopnumberThe minimum value of the top property.
maxTopnumberThe maximum value of the top property.
Source: