Sometimes in order to tidy up the layout, the page display of the picture must be limited to a wide, if you want to click on the image to enlarge to the original size of the preview, again click Back to the original appearance, you need to use the following code:
Var _w = parseint ($ (window). width ());//Gets the breadth of the browser $ ("#abc img"). each (function (i) { var img = this; var realwidth;//true Width var realheight;//true Height $ ("=_w) { $ (IMG). CSS ({ "width": "100%", "Height" : "Auto", "position": "fixed", "Top": "50%", "left": "50%", "Margin-top": " -30%", "Margin-left": " -50%" }); }else{ $ ( IMG). CSS ({ "width": realwidth, "Height": realheight, "position": "Fixed", "Top": "50%", "left": "50%", "Margin-top": -realheight / 2, "Margin-left": -realwidth / 2 }); } flag = 0; } else { $ (IMG). CSS ({ "width": 500, "Height": 400, }); flag = 1; (   }    });});
The above code to obtain the original width of the picture is reproduced, after processing as above. Pro-Test effective, but for the image upload, after the click Method, seemingly do not get to the original width, I think it should be the reason of load, but also understand the big God more guidance, how to achieve the uploaded picture file, click the thumbnail, zoom to the original size!!!
This article is from the "Small Syria frontend" blog, please be sure to keep this source http://beileixinqing.blog.51cto.com/7540036/1881158
Click image to enlarge to original image size