Tuesday, 27 August 2013

php javascript image onclick zoom

php javascript image onclick zoom

below code in php is not working, but it is working in html.
here my php code:
echo "<img src='./myimages/".$a."' onclick='zoom(./web/".$a.",400,500);'
width='100px' height='91px'>";
//here my javascript code(zoom.js)
function zoom(photo, w, h) {
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);
var targetWin = window.open(photo, 'titlebar=0, toolbar=no,
location=no, directories=no, status=no, menubar=no, scrollbars=no,
resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top='
+ top + ', left=' + left);
}

No comments:

Post a Comment