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 type="text/javascript">
       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

    plus.png minus.png fullscreen.png close.png closebig.png up.png right.png down.png left.png reset.png print.png

    Mobile buttons (for phones, tablets, touchscreens) https://www.magictoolbox.com/static/magictouch/themes/default/css/mobile.css

    buttons03.png navigate-up.png ajax-loder-big.png

    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 type="text/javascript">
       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
      plus.png minus.png nav.png fullscreen.png close.png closebig.png top.png right.png bottom.png left.png reset.png background.png print.png
    • https://www.magictoolbox.com/static/magictouch/3dlight-blue.xml
      plus.png minus.png nav.png fullscreen.png close.png closebig.png top.png right.png bottom.png left.png reset.png background.png print.png
    • https://www.magictoolbox.com/static/magictouch/3dlight-red.xml
      plus.png minus.png nav.png fullscreen.png close.png closebig.png top.png right.png bottom.png left.png reset.png background.png print.png
    • https://www.magictoolbox.com/static/magictouch/3dlight-green.xml
      plus.png minus.png nav.png fullscreen.png close.png closebig.png top.png right.png bottom.png left.png reset.png background.png print.png
    • https://www.magictoolbox.com/static/magictouch/magic-gray.xml
      plus.png minus.png nav.png fullscreen.png close.png closebig.png top.png right.png bottom.png left.png reset.png background.png print.png
    • https://www.magictoolbox.com/static/magictouch/magic-blue.xml
      plus.png minus.png nav.png fullscreen.png close.png closebig.png top.png right.png bottom.png left.png reset.png background.png print.png
    • https://www.magictoolbox.com/static/magictouch/magic-red.xml
      plus.png minus.png nav.png fullscreen.png close.png closebig.png top.png right.png bottom.png left.png reset.png background.png print.png
    • https://www.magictoolbox.com/static/magictouch/magic-green.xml
      plus.png minus.png nav.png fullscreen.png close.png closebig.png top.png right.png bottom.png left.png reset.png background.png print.png

    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 type="text/javascript">
      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 Full Screen icon). By default, it only shows on the fullscreen image.

    Magic Touch™ integration

    To add a watermark:

    1. Create a PNG image with transparency (example PNG). A minimalist design in grey ususally works well as it is not overly intrusive.
    2. 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.
    3. Add the watermark parameter and specify the URL of your PNG image.
    4. 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 type="text/javascript">
     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:

    1. Create a .htaccess file, for example:

      AuthType Basic
      AuthName "MagicTouch Protected Area"
      AuthUserFile /path/to/.htpasswd
      Require valid-user
      
    2. 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
      
    3. 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 type="text/javascript">
    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.

    List of parameters
    ParameterDefaultOptionsDescription
    Zoom
    levels 2 - 9Quantity of zoom levels, calculated automatically.
    smoothing81 - 100Smooth movement while dragging image.
    Background, borders and progress bar
    border-width0numericBorder width in pixels (0=none).
    border-color'#006b66'hex colorBorder color
    progress-height10numericProgress bar height in pixels (0=off).
    progress-color'#00501f'hex colorProgress bar color.
    background-color'#fff'hex colorBackground colour for full-screen mode.
    Buttons
    button-position-y'top'top/bottomPosition of the +/- buttons.
    button-position-x'left'left/rightPosition of the +/- buttons.
    button-margin10numericDistance of buttons from edges, in pixels.
    button-alpha700-100Button transparency.
    button-alpha-hover1000-100Button transparency on mouseover.
    button-orientation'vertical'vertical / horizontalAlignment of buttons.
    button-padding2numericDistance between + and - buttons, in pixels.
    plus-urlurlChoose your own + image e.g. http://www.example.com/plus.png
    minus-urlurlChoose your own - image e.g. http://www.example.com/minus.png
    nav-show10 / 1Show/hide navigation buttons.
    nav-alpha300-100Nav button transparency.
    nav-urlurlChoose your own Ο image e.g. http://www.example.com/nav.png
    Arrows
    arrow-showtruetrue / falseShow arrows or not.
    arrow-move40numericAmount of movement on arrow click, in pixels.
    arrow-position-y'bottom'top / bottomVertical position of arrows.
    arrow-position-x'right'left / rightHorizontal position of arrows.
    arrow-topurlChoose your own top arrow e.g. http://www.example.com/top.png
    arrow-righturlChoose your own right arrow e.g. http://www.example.com/right.png
    arrow-bottomurlChoose your own bottom arrow e.g. http://www.example.com/bottom.png
    arrow-lefturlChoose your own left arrow e.g. http://www.example.com/left.png
    arrow-reseturlChoose your own reset image e.g. http://www.example.com/reset.png
    arrow-alpha700-100Transparency of arrows.
    arrow-alpha-hover1000-100Transparency of arrows on hover.
    arrow-backgroundurlChoose your own arrow background e.g. http://www.example.com/background.png
    arrow-background-alpha1000-100Transparency of arrow background.
    arrow-background-offset-x0numericMove the background image of the arrow.
    arrow-background-offset-y0numericMove the background image of the arrow.
    Full-screen
    fullscreentruetrue / falseFull-screen feature.
    fullscreen-btn-scale300-100Size of buttons on full-screen.
    btn-fullscreenurlChoose your own image e.g. http://www.example.com/fullscreen.png
    btn-closeurlChoose your own image e.g. http://www.example.com/close.png
    btn-close-bigurlChoose your own image e.g. http://www.example.com/close-big.png
    Preview Area
    preview-size250-100Size of the preview area.
    preview-alpha500-100Transparency of preview area.
    preview-position-y'bottom'top / bottomVertical position of preview.
    preview-position-x'left'left / rightHorizontal position of preview.
    preview-selection-alpha750-100Opacity of rectangle within preview.
    Selector thumbnails
    selectors-class any text Apply a CSS class to style the active selector.
    selectors-opacity 0-100Change the opacity of the non-selected thumbnails.
    Full-screen thumbnails
    thumbnails-positionbottomtop / bottomPosition of thumbnails in full-screen view.
    thumbnails-alpha700-100Opacity of thumbnails in full-screen view.
    thumbnails-alpha-hover1000-100Hover-opacity of thumbnails.
    thumbnails-padding10numericPadding of thumbnails.
    thumbnails-border-color#c2c2c2hex colorThumbnail border color.
    thumbnails-border-width1numericThumbnail border width.
    thumbnails-max-height0numericMax height of thumbnails in full-screen view (0 = none).
    thumbnails-max-width0numericMax width of thumbnails in full-screen view (0 = none).
    Watermark
    watermarkurlAdd a watermark PNG (paid users only)
    e.g. http://www.example.com/watermark.png. More details
    watermark-alpha100-100Transparency of the watermark.
    watermark-normalfalsetrue / falseShow watermark in normal view.
    watermark-fullscreentruetrue / falseShow watermark in full-screen.
    fullscreen-onlyfalsetrue / falseClick anywhere on image to activate fullscreen. More details
    fullscreen-only-imageurlURL of your image for fullscreen-only.
    Custom logo
    custom-logourlChoose your own logo (paid users only) e.g. http://www.example.com/logo.png
    custom-logo-position-x'right'left / rightYour logo position.
    custom-logo-position-y'top'top / bottomYour logo position.
    Other features
    theme-urlurlChoose a different theme for buttons (see 8 themes).
    loaderurlChoose your own loading image e.g. http://www.example.com/loader.png
    Turn off the loading image with: "loader" : ""
    savefalse true / falseRight click option to "Save image".
    printfalseentire / part / falseShows a button to print the image.
    btn-printurlChoose your own image e.g. http://www.example.com/print.png
    JavaScript version only features
    autostarttrue true / falseRun Magic Touch™ on domready.
    engine JSRun Magic Touch™ in JavaScript-only mode.
    fullscreenHideControlsTimeout4000numeric Timeout to hide preview, arrows, etc in fullscreen mode (milliseconds).
    fullscreenHideSelectorsTimeout4000numericTimeout to hide thumbnails in fullscreen mode (milliseconds).
    stylesheet urlURL if you use a custom desktop CSS file (info).
    stylesheetMobile urlURL if you use a custom mobile CSS file (info).