jQuery 图像裁剪插件Jcrop
, // 设置框的最大宽度
setSelect: [ 175, 100, 400, 300 ]
});
$('#text-inputs').on('change','input',function(e){
$('#target').Jcrop('api').animateTo([
parseInt(d[ge]('crop-x').value),
parseInt(d[ge]('crop-y').value),
parseInt(d[ge]('crop-w').value),
parseInt(d[ge]('crop-h').value)
]);
});
});
</script>
<link rel="stylesheet" href="demo_files/main.css">
<link rel="stylesheet" href="demo_files/demos.css">
<link rel="stylesheet" href="../css/Jcrop.css">
<style>
#text-inputs { margin: 10px 8px 0; }
.input-group { margin-right: 1.5em; }
.nav-box { width: 750px; padding: 0 !important; margin: 4px 0; background-color: #f8f8f7; }
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="span12">
<div class="jc-demo-box">
<div id="interface" class="page-interface"><img src="http://jcrop-cdn.tapmodo.com/assets/images/sierra2-750.jpg" id="target"></div>
<div class="nav-box">
<form onsubmit="return false;" id="text-inputs"><span class="input-group"><b>X</b>
<input type="text" name="cx" id="crop-x" class="span1"></span><span class="input-group"><b>Y</b>
<input type="text" name="cy" id="crop-y" class="span1"></span><span class="input-group"><b>W</b>
<input type="text" name="cw" id="crop-w" class="span1"></span><span class="input-group"><b>H</b>
<input type="text" name="ch" id="crop-h" class="span1"></span>
</form>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
</body>
</html>