在我的应用程序中,我有一个div,一个按钮的图像.
我想旋转显示的图像,并在使用jquery单击按钮时保存旋转的图像.
我已经使用过代码:
http://code.google.com/p/jquery-rotate/
和jquery代码:
$(function() { // doc ready
var rotation = 0; // variable to do rotation with
$("#img").click(function() {
rotation = (rotation + 45) % 360; // the mod 360 probably isn't needed
$("#cropbox").rotate(rotation);
});
});
Run Code Online (Sandbox Code Playgroud)
HTML代码:
<img src="demo_files/pool.jpg" id="cropbox" />
<input type="button" id="img" name="img" value="click" />
Run Code Online (Sandbox Code Playgroud)
当我使用上面的代码时,有两个图像,一个是旧图像,另一个是旋转图像.
在这里,我想旋转相同的图像,只显示旋转的图像.并将旋转的图像保存在目录中.
我怎么能用jquery做到这一点?如果用jquery不可能那么我怎么能用php/ajax做到这一点?