我正在使用Apache Cordova创建移动应用程序,我有一个div和两个按钮(一个用于导入图片,另一个用于旋转图片)。当我插入图片时,图片显示在div内部,我可以用另一个替换它,但如果我旋转图片我不能导入另一个?
var destinationType=navigator.camera.DestinationType;
$("#capture").click(function () {
getPhoto(navigator.camera.PictureSourceType.SAVEDPHOTOALBUM);
});
function getPhoto(source) {
// Retrieve image file location from specified source
navigator.camera.getPicture(cameraSuccess, cameraError, {
quality: 50,
sourceType: Camera.PictureSourceType.SAVEDPHOTOALBUM
});
}
var cameraSuccess = function (imageData) {
var image = document.getElementById('pic');
image.src = imageData;
return image.src;
}
var cameraError = function () {
alert("Error");
}
$("#left").click(function () {
$("#pic").rotate(90);
});