|
-
- function readURL(input) {
- if (input.files && input.files[0]) {
- var reader = new FileReader();
- reader.onload = function (e) {
- $(input).closest("div.row").find("div.previewrapper > img.uploadpreview").attr('src', e.target.result)
- $(input).closest("div.row").find("div.previewrapper").removeClass("hide");
- $(input).closest("div.row").find("div.previewrapper").fadeIn(1000)
- }
- reader.readAsDataURL(input.files[0]);
- }
- }
-
- $(".uploadimg").change(function(){
- readURL(this);
- });
-
- $("div.previewrapper > img.removepreview").click(function(){
- $(this).closest("div.row").find("input.uploadimg").val('');
- $(this).closest("div.row").find("input.file-path").val('');
- $(this).closest("div.previewrapper").fadeOut(1000);
- });
-
- function isWeixinBrowser(){
- var ua = navigator.userAgent.toLowerCase();
- return (/micromessenger/.test(ua)) ? true : false ;
- }
-
- function closeWechatBrowser(){
- if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
- WeixinJSBridge.call('closeWindow');
- }
- $(document).on("WeixinJSBridgeReady", function(){
- WeixinJSBridge.call('closeWindow');
- });
- }
|