function ZoomImage(zoom){
var image=document.getElementById('image');
if(!image){return};
image.setAttribute('width',parseInt(image.getAttribute('width'))+zoom);
image.setAttribute('height',parseInt(image.getAttribute('height'))+zoom);
if(!image.style.left){image.style.left='0px'};
if(!image.style.top){image.style.top='0px'};
image.style.left=parseInt(image.style.left)-(zoom/2)+'px';
image.style.top=parseInt(image.style.top)-(zoom/2)+'px';
}
window.onload=function(){
var control1=document.getElementById('ZoomIn');
if(!control1){return};
control1.onclick=function(){
ZoomImage(20);
}
var control2=document.getElementById('ZoomOut');
if(!control2){return};
control2.onclick=function(){
ZoomImage(-20);
}
}
I’m looking to adapt our JavaScript/HTML based mapping software (very similar to Google maps, but specific to an industry) so that it can be used on a HP Touchsmart monitor. The main thing I cannot find help on is how to capture the zoom in and zoom out commands triggered by dragging two touch points either closer or farther away from each other. For example, you can zoom out by dragging your thumb and index finger together. Does anyone know where I can find information on how to capture these zoom events in JavaScript? Is there any way of automatically mapping the zoom in and out events so that they trigger the mouse scroll handlers? (Like Google maps, you can already zoom in and out of our maps using the mouse scroll button).
Any help would be most appreciated.
RSS


View unverified member's comment - posted by Builda