Images used are copyrighted and are used for demonstration only.
Download loupe.js and include it into your webpages HEAD section.
<script type="text/javascript" src="loupe.js"></script>
To add a loupe just set the event onload="loupe.add(this);" to an div surrounded image.
<div>
<img id="..." onload="loupe.add(this);" src="..." width="356" height="205" alt="...">
</div>
loupe.defaultResopath = 'images/loupe/'; //STRING path to image resources (loupe.png|lense.png|icon.png)loupe.defaultVisible = false; //BOOLEAN visiblity on startuploupe.defaultRadius = 100; //INT/FLOAT 0-100 lense radius (%) of loupe min(height/width)loupe.defaultXpos = 8; //INT/FLOAT 0-n (px) horizontal offset of the lenseloupe.defaultYpos = 6; //INT/FLOAT 0-n (px) vertical offset of the lenseloupe.defaultXview = 0; //INT/FLOAT 0-n (px) horizontal start positionloupe.defaultYview = 0; //INT/FLOAT 0-n (px) vertical start positionloupe.defaultCrosshair = false; //BOOLEAN show crosshairloupe.defaultOpacity = 25; //INT/FLOAT 0-100 (%) crosshair opacityloupe.defaultColor = '#0000ff'; //STRING crosshair colorloupe.defaultName = ''; //STRING (canvas name|id)loupe.add(image[, options]);image == div surrounded imageoptions e.g. {visible: true, opacity: 25, ...}resopath == STRING Default: 'images/loupe/'visible == BOOLEAN true or false Default: falseradius == INT/FLOAT 0 - 100 Default: 100xpos == INT/FLOAT 0 - n Default: 8ypos == INT/FLOAT 0 - n Default: 6xview == INT/FLOAT 0 - 100 Default: 0yview == INT/FLOAT 0 - 100 Default: 0crosshair == BOOLEAN true or false Default: falseopacity == INT/FLOAT 0 - 100 Default: 25color == STRING Default: '#0000ff'name == STRING Default: ''loupe.toggle(canvas.id);loupe.remove(canvas);<img onload="loupe.add(this);" ...>loupe.add(document.getElementById('img'));if(typeof $=='undefined') {function $(v) {return(document.getElementById(v));}}loupe.add($('img'), {name:'magnifier', resopath:'loupes/'});<button type="button" onclick="loupe.toggle('magnifier');"> toggle </button>alert('loupe: '+loupe.version+' ('+loupe.released+')');loupe.remove($('magnifier'));In older browsers, the script degrades and your visitors won't notice a thing.
Please read the license before you download loupe.js 2.0
Please read the Frequently Asked Questions before you contact the author.
Version 2.0
Please leave any comments at this contact formular.
loupe.js is distributed under the Netzgestade Non-commercial Software License Agreement.
License permits free of charge use on non-commercial and private web sites only under special conditions (as described in the license).
This license equals neither "open source" nor "public domain".
There are also Commercial Software Licenses available.