<body>
<img class="close_btn" οnclick="close_layer();" src="../images/error.png" />
<div id="imgContainer">
<img id="imageFullScreen" src="../images/qjt_df.png" />
</div>
</body>
<script type="text/javascript" src="../js/jquery-2.1.1.min.js" ></script>
<script type="text/javascript" src="../js/e-smart-zoom-jquery.min.js" ></script>
window.οnlοad=function()//用window的onload事件,窗体加载完毕的时候
{
$('#imageFullScreen').smartZoom({'containerClass':'zoomableContainer'});
$('#topPositionMap,#leftPositionMap,#rightPositionMap,#bottomPositionMap').bind("click", moveButtonClickHandler);
$('#zoomInButton,#zoomOutButton').bind("click", zoomButtonClickHandler);
function zoomButtonClickHandler(e){
var scaleToAdd = 0.8;
if(e.target.id == 'zoomOutButton')
scaleToAdd = -scaleToAdd;
$('#imageFullScreen').smartZoom('zoom', scaleToAdd);
}
function moveButtonClickHandler(e){
var pixelsToMoveOnX = 0;
var pixelsToMoveOnY = 0;
switch(e.target.id){
case "leftPositionMap":
pixelsToMoveOnX = 50;
break;
case "rightPositionMap":
pixelsToMoveOnX = -50;
break;
case "topPositionMap":
pixelsToMoveOnY = 50;
break;
case "bottomPositionMap":
pixelsToMoveOnY = -50;
break;
}
$('#imageFullScreen').smartZoom('pan', pixelsToMoveOnX, pixelsToMoveOnY);
}
}