Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add viewport_width and viewport_height options

  • Loading branch information...
commit 9e1d77f1fe5d2495edd19b11d7aca1a1d563738f 1 parent e728c24
@trepmag authored
Showing with 7 additions and 0 deletions.
  1. +2 −0  README.txt
  2. +5 −0 jrac/jquery.jrac.js
View
2  README.txt
@@ -40,6 +40,8 @@ The default setting object is the following:
'zoom_min': 100,
'zoom_max': 3000,
'viewport_image_surrounding': false, // Set the viewport to surround the image on load
+ 'viewport_width': null,
+ 'viewport_height': null,
'viewport_resize': true,
// The two following properties allow to position the content (negative
// value allowed). It can be use to focus the viewport on the cropped
View
5 jrac/jquery.jrac.js
@@ -22,6 +22,8 @@
'zoom_min': 100,
'zoom_max': 3000,
'viewport_image_surrounding': false, // Set the viewport to surround the image on load
+ 'viewport_width': null,
+ 'viewport_height': null,
'viewport_resize': true,
// The two following properties allow to position the content (negative
// value allowed). It can be use to focus the viewport on the cropped
@@ -108,6 +110,9 @@
if (settings.viewport_image_surrounding) {
$viewport.width($image.width()).height($image.height());
}
+ else {
+ $viewport.width(settings.viewport_width).height(settings.viewport_height);
+ }
// Set the viewport content position for the image
$image.css({'left': settings.viewport_content_left, 'top': settings.viewport_content_top});
Please sign in to comment.
Something went wrong with that request. Please try again.