主要整合了uploadify 和 Jcrop,可分为图片上传+图片上传裁切。 带切图的图片上传 $(function(){ //使用插件 $("#file_upload").jqUpCrop(); /* 默认参数 var defaults ={ buttonText : "上传图片", completeText : "已完成!", cancelText : "已取消!", multi : false, fileTypeDesc : "图片", fileTypeExts : "*.gif;*.jpg;*.png", swf : "uploadify.swf", fileSizeLimit : "2048KB", uploader : "uploadify.php", onUploadSuccess : function(file,data,res){}, bigImg : "#bigImg", smallImg : "#smallImg", smallImgWp: "#preview_box", upfolder : "uploads/", [...]
涂鸦
解决window.open被浏览器阻止
window.open(url) 可以新开窗口跳转链接。但现在往往很多浏览器的安全设置和屏蔽广告机制,会阻止window.open事件。 同一页面可以模拟a标签跳转,利用window.location.href=url进行跳转。 由于项目是弹出框里面的iframe,需要父窗口弹出且不被浏览器阻止,GG之,发现还可以利用form提交形式,于是就有了: //父窗口对象 var body = window.parent.document.body; //orderid 通过ajax方式取得,创建表单对象 var orderForm = $('<form action="/order/order.php" method="get" target="_blank"><input type="hidden" name="orderid" value="'+orderid+'" /></form>'); //添加表单dom 到父窗口并提交表单 orderForm.appendTo($(body)).submit(); ///








