1. Installation
If you're using one of these platforms, click your platform and follow the instructions to install the Magic Touch™ module:
If you're not using one of the platforms above, use the instructions below. Just 3 steps to add Magic Touch™ to your website:
1. Sign up to get your unique JS file (free and paid versions available).
2. Copy the code for your unique JS file, for example:
<p><script src="http://www.magictoolbox.com/mt/YOURCODE/magictouch.js" type="text/javascript"></script></p>
3. Insert your two images, for example:
<p><a href="large.jpg" class="MagicTouch"><img src="small.jpg"></a></p>
That's it! No iframes, frames or XML feeds. Just clean HTML as it was meant to be. For help, please contact us.
Installation is also explained in this short video:
2. Customization
Make it look perfect on your site, with more than 70 customisation parameters below.
Either apply your parameters in a rel tag inside the <a>, e.g.
<p><a href="large.jpg" class="MagicTouch" rel="levels:3; print:part; smoothing:12"><img src="small.jpg"></a></p>
Or apply your options in a <script> tag before the </head>, like so:
<script> MagicTouch.options = { 'levels' : 3, 'print' : 'part', 'smoothing' : 12 } </script>
There should be no comma after the last parameter, otherwise Internet Explorer will throw a JavaScript error (a well documented bug in IE).
3. Multiple images
Use thumbnail images to swap the main image (example). It's perfect if you have more than one product photo. You just need to place rel and rev tags in the href. Example:
<p><a href="image1-huge.jpg" id="monkey" class="MagicTouch"><img src="image1-main.jpg"></a></p> <p><a href="image1-huge.jpg" rel="monkey" rev="image1-main.jpg"><img src="image1-small.jpg"></a> <a href="image2-huge.jpg" rel="monkey" rev="image2-main.jpg"><img src="image2-small.jpg"></a> <a href="image3-huge.jpg" rel="monkey" rev="image3-main.jpg"><img src="image3-small.jpg"></a></p>
4. Buttons
Buttons are automatically larger for mobile devices (phones and tablets) to make them easy to click. They are set in these 2 CSS files - one for display on desktop/laptop computer, another for mobile touch screen devices.
The default buttons are:
Standard buttons (for desktops, laptops) https://www.magictoolbox.com/static/magictouch/themes/default/css/desktop.css
Mobile buttons (for phones, tablets, touchscreens) https://www.magictoolbox.com/static/magictouch/themes/default/css/mobile.css
You can create your own custom buttons instead, or you can choose one of the button themes below.
You can also change CSS files entirely by creating your own and saving them on your website, referencing them like so:
MagicTouch.options = { 'stylesheet' : 'http://example.com/dekstop.css', 'stylesheetMobile' : 'http://example.com/mobile.css' }
5. Custom buttons
To replace the default buttons, design your own and upload them to your website, then specify them in your code. For example:
<script> MagicTouch.options = { 'watermark' : 'http://www.example.com/watermark.png', 'btn-fullscreen' : 'http://www.example.com/fullscreen.png', 'btn-close' : 'http://www.example.com/close.png' } </script>
You must also download this crossdomain.xml file (right click, Save as...) and upload it to the root of your web server i.e. http://www.example.com/crossdomain.xml. This permits the SWF on the Magic Touch™ servers to reference the buttons on your domain.
6. Themes
Alternatively, choose one of these existing button themes:
- https://www.magictoolbox.com/static/magictouch/3dlight.xml
- https://www.magictoolbox.com/static/magictouch/3dlight-blue.xml
- https://www.magictoolbox.com/static/magictouch/3dlight-red.xml
- https://www.magictoolbox.com/static/magictouch/3dlight-green.xml
- https://www.magictoolbox.com/static/magictouch/magic-gray.xml
- https://www.magictoolbox.com/static/magictouch/magic-blue.xml
- https://www.magictoolbox.com/static/magictouch/magic-red.xml
- https://www.magictoolbox.com/static/magictouch/magic-green.xml
To change the theme, use the theme-url parameter, for example:
<a href="large.jpg" class="MagicTouch" rel="theme-url:http://www.magictoolbox.com/static/magictouch/3dlight.xml"><img src="small.jpg"></a>
Or reference it using the script tag:
<script> MagicTouch.options = { 'theme-url':'http://www.magictoolbox.com/static/magictouch/3dlight.xml' } </script>
7. Save image
You can permit users to save the image on right click like so:
<a href="large.jpg" class="MagicTouch" rel="save: true"><img src="small.jpg"></a>
8. Watermark
You can add branding and a basic level of protection by adding a watermark to your images.
This example shows a watermark on both the standard image and the full screen image (click the icon). By default, it only shows on the fullscreen image.
To add a watermark:
- Create a PNG image with transparency (example PNG). A minimalist design in grey ususally works well as it is not overly intrusive.
- Upload your PNG to your website and also upload this crossdomain.xml file (right click, Save as...) to the root of your web server i.e. http://www.example.com/crossdomain.xml.
- Add the watermark parameter and specify the URL of your PNG image.
- Add any other optional parameters you wish, such as watermark-alpha (to adjust transparency). See below for all watermark parameters.
Your code might look something like this:
<script> MagicTouch.options = { 'watermark' : 'http://www.example.com/watermark.png', 'watermark-alpha' : 10, 'watermark-normal' : 0, 'watermark-fullscreen' : 1 } </script>
9. Image protection
Your original large images can be downloaded by users as the image locations are shown in the source code of your page.
To protect your large images, you can use HTTP Basic Authentication to require a password and give Magic Touch™ permission to fetch them like so:
Create a .htaccess file, for example:
AuthType Basic AuthName "MagicTouch Protected Area" AuthUserFile /path/to/.htpasswd Require valid-user
Create a .htpasswd file with the htpasswd system utility (this comes with Apache), for example:
# htpasswd -c /path/to/.htpasswd magictouch New password: mypassword Re-type new password: mypassword Adding password for user magictouch
- Enter the username/password in your Magic Touch™ control panel.
Contact us if you would like help with this.
10. JavaScript & Flash versions
Magic Touch™ can work in either JavaScript or Flash mode. By default, it will use Flash when Flash is available and otherwise use JavaScript (for iOS and touchscreen devices).
There are some extra features available in the JavaScript version.
The following features are not available in the JavaScript version:
- Progress bar
- Watermark
- Custom logo
- Styling options from the Flash version (all styling is done via CSS in the JS version)
- Thumbnails in fullscreen mode can only be positioned at the bottom of the screen
11. JavaScript only
You can set Magic Touch™ to always use the JavaScript version (example) like so:
<script> MagicTouch.options = { engine: 'JS' } </script>
12. Debug
You can use debug mode to identify any problems such as missing images. Simply add #mtdebugmode to the end of the URL you are testing, for example:
http://www.example.com/gucci-bag-4/#mtdebugmode
Enable Firebug and look at the console to see any error messages. Screenshot.
If you don't use Firebug or an equivalent console, any error messages will show as an alert() in your browser instead.
13. Parameters
To apply any of the 70 options below, use one of the two methods described above under Customization.
Parameter | Default | Options | Description |
---|---|---|---|
Zoom | |||
levels | 2 - 9 | Quantity of zoom levels, calculated automatically. | |
smoothing | 8 | 1 - 100 | Smooth movement while dragging image. |
Background, borders and progress bar | |||
border-width | 0 | numeric | Border width in pixels (0=none). |
border-color | '#006b66' | hex color | Border color |
progress-height | 10 | numeric | Progress bar height in pixels (0=off). |
progress-color | '#00501f' | hex color | Progress bar color. |
background-color | '#fff' | hex color | Background colour for full-screen mode. |
Buttons | |||
button-position-y | 'top' | top/bottom | Position of the +/- buttons. |
button-position-x | 'left' | left/right | Position of the +/- buttons. |
button-margin | 10 | numeric | Distance of buttons from edges, in pixels. |
button-alpha | 70 | 0-100 | Button transparency. |
button-alpha-hover | 100 | 0-100 | Button transparency on mouseover. |
button-orientation | 'vertical' | vertical / horizontal | Alignment of buttons. |
button-padding | 2 | numeric | Distance between + and - buttons, in pixels. |
plus-url | url | Choose your own + image e.g. http://www.example.com/plus.png | |
minus-url | url | Choose your own - image e.g. http://www.example.com/minus.png | |
nav-show | 1 | 0 / 1 | Show/hide navigation buttons. |
nav-alpha | 30 | 0-100 | Nav button transparency. |
nav-url | url | Choose your own Ο image e.g. http://www.example.com/nav.png | |
Arrows | |||
arrow-show | true | true / false | Show arrows or not. |
arrow-move | 40 | numeric | Amount of movement on arrow click, in pixels. |
arrow-position-y | 'bottom' | top / bottom | Vertical position of arrows. |
arrow-position-x | 'right' | left / right | Horizontal position of arrows. |
arrow-top | url | Choose your own top arrow e.g. http://www.example.com/top.png | |
arrow-right | url | Choose your own right arrow e.g. http://www.example.com/right.png | |
arrow-bottom | url | Choose your own bottom arrow e.g. http://www.example.com/bottom.png | |
arrow-left | url | Choose your own left arrow e.g. http://www.example.com/left.png | |
arrow-reset | url | Choose your own reset image e.g. http://www.example.com/reset.png | |
arrow-alpha | 70 | 0-100 | Transparency of arrows. |
arrow-alpha-hover | 100 | 0-100 | Transparency of arrows on hover. |
arrow-background | url | Choose your own arrow background e.g. http://www.example.com/background.png | |
arrow-background-alpha | 100 | 0-100 | Transparency of arrow background. |
arrow-background-offset-x | 0 | numeric | Move the background image of the arrow. |
arrow-background-offset-y | 0 | numeric | Move the background image of the arrow. |
Full-screen | |||
fullscreen | true | true / false | Full-screen feature. |
fullscreen-btn-scale | 30 | 0-100 | Size of buttons on full-screen. |
btn-fullscreen | url | Choose your own image e.g. http://www.example.com/fullscreen.png | |
btn-close | url | Choose your own image e.g. http://www.example.com/close.png | |
btn-close-big | url | Choose your own image e.g. http://www.example.com/close-big.png | |
Preview Area | |||
preview-size | 25 | 0-100 | Size of the preview area. |
preview-alpha | 50 | 0-100 | Transparency of preview area. |
preview-position-y | 'bottom' | top / bottom | Vertical position of preview. |
preview-position-x | 'left' | left / right | Horizontal position of preview. |
preview-selection-alpha | 75 | 0-100 | Opacity of rectangle within preview. |
Selector thumbnails | |||
selectors-class | any text | Apply a CSS class to style the active selector. | |
selectors-opacity | 0-100 | Change the opacity of the non-selected thumbnails. | |
Full-screen thumbnails | |||
thumbnails-position | bottom | top / bottom | Position of thumbnails in full-screen view. |
thumbnails-alpha | 70 | 0-100 | Opacity of thumbnails in full-screen view. |
thumbnails-alpha-hover | 100 | 0-100 | Hover-opacity of thumbnails. |
thumbnails-padding | 10 | numeric | Padding of thumbnails. |
thumbnails-border-color | #c2c2c2 | hex color | Thumbnail border color. |
thumbnails-border-width | 1 | numeric | Thumbnail border width. |
thumbnails-max-height | 0 | numeric | Max height of thumbnails in full-screen view (0 = none). |
thumbnails-max-width | 0 | numeric | Max width of thumbnails in full-screen view (0 = none). |
Watermark | |||
watermark | url | Add a watermark PNG (paid users only) e.g. http://www.example.com/watermark.png. More details | |
watermark-alpha | 10 | 0-100 | Transparency of the watermark. |
watermark-normal | false | true / false | Show watermark in normal view. |
watermark-fullscreen | true | true / false | Show watermark in full-screen. |
fullscreen-only | false | true / false | Click anywhere on image to activate fullscreen. More details |
fullscreen-only-image | url | URL of your image for fullscreen-only. | |
Custom logo | |||
custom-logo | url | Choose your own logo (paid users only) e.g. http://www.example.com/logo.png | |
custom-logo-position-x | 'right' | left / right | Your logo position. |
custom-logo-position-y | 'top' | top / bottom | Your logo position. |
Other features | |||
theme-url | url | Choose a different theme for buttons (see 8 themes). | |
loader | url | Choose your own loading image e.g. http://www.example.com/loader.png Turn off the loading image with: "loader" : "" | |
save | false | true / false | Right click option to "Save image". |
false | entire / part / false | Shows a button to print the image. | |
btn-print | url | Choose your own image e.g. http://www.example.com/print.png | |
JavaScript version only features | |||
autostart | true | true / false | Run Magic Touch™ on domready. |
engine | JS | Run Magic Touch™ in JavaScript-only mode. | |
fullscreenHideControlsTimeout | 4000 | numeric | Timeout to hide preview, arrows, etc in fullscreen mode (milliseconds). |
fullscreenHideSelectorsTimeout | 4000 | numeric | Timeout to hide thumbnails in fullscreen mode (milliseconds). |
stylesheet | url | URL if you use a custom desktop CSS file (info). | |
stylesheetMobile | url | URL if you use a custom mobile CSS file (info). |