Zoom - GrayYoung/jQuery.UI.Extension GitHub Wiki

options

alwaysOn

Type: Boolean | Default: false

Always show the zoom view.

Code examples:

$('#zoom').zoom({
    alwaysOn : true
});

center

Type: Boolean | Default: true

Position the image to center.

Code examples:

$('#zoom').zoom({
    center : false
});

extraClass

Type: Object | Default: null

Add other classes to the widget.

frame

Type: String

content

Type: String

item

Type: String

height

Type: String or Number| Default: "auto"

The height of the zoom view.

hide

Type: Object | Default: null

How to animate the hiding of the element. See more

position

Type: Object | Default: { my : "left top", at : "right+30 top", collision : "none" }

The position of the zoom view. This value only for type[ standard | drag ], but 'inner'.
See API.jQueryUI.Position.

preload

Type: Boolean| Default: true

If preload the larger image.

show

Type: Object | Default: null

How to animate the showing of the element. See more

width

Type: String or Number | Default: "auto"

The width of the zoom view.

times

Type: Number | Default: 0

Magnification of the zoom image.

type

Type: String | Default: "standard" | [ standard | inner | drag ]

How to position the zoom image.

Methods

refresh

Refresh image of the zoom view, it's obvious if you change the image src attribute.
This method does not accept any arguments.
#####Code examples: $( ".selector" ).zoom("refresh");

destroy

Removes the dialog functionality completely. This will return the element back to its pre-init state.
This method does not accept any arguments.
#####Code examples: $( ".selector" ).zoom("destroy");

Events

create

Triggered when the wigdet is created.

  • event
    Type: Event
  • ui
    Type: Object Note: The ui object is empty but included for consistency with other events. This method does not accept any arguments.

#####Code examples: Initialize the dialog with the create callback specified:
$( ".selector" ).zoom({ create: function( event, ui ) {} });

Example

<div id="jq_ui-zoom" style="width: 400px; height: 600px;" class="row photoViewer" data-src="http://placehold.it/1000x1252&text=Product Photo">
  <img src="http://placehold.it/400x600&text=Product Photo A" alt="Product Photo" title="Product Photo" />
</div>

var $zoom = $('#jq_ui-zoom').zoom({
  type : 'inner'
});

⚠️ **GitHub.com Fallback** ⚠️