JS capture image upload (principle only)----idle boring code will not be shared! Bad writing, sorry to show you (embarrassed)

Source: Internet
Author: User

Even if the world is the father, there are always some attributes that will take you out of despair (great Absolute)

Spit It out today! ...... There is no Orthodox UI in my world, so it will always be such a pit daddy!

Here I would like to thank for having a position:absolute; t_t

When it comes to a variety of unreasonable layouts, at least it

Spit Groove finished!!!

This is a simple image capture tool!! It's a little rough, I admit.

First step, no big problem, parse picture format

The picture is nothing more than png,jpg,gif all the extra alert boxes to tell them to change

The second step, it's nothing weird. Difficulty, just set the mouse shape

The third step is still no difficulty. Get the position of the mouse to press down Event.clientx,event.clienty, release the position Event.clientx,event.clienty

The fourth step is still not difficult!

It's just a 4-block position with absolute positioning.

Add a gray transparent

Sixth step or no difficulty, altogether so 6 points the mouse presses down the trigger function, then releases remembers the position adjusts the image

The 7th side of the thumbnail, nothing else is to adjust the image size and position (margin what can) anyway, the most outside wrapped with an avatar width and height, the extra over-flow:hidden is good

8th upload image, Ajax return to processed pictures

JS capture image upload (principle only)----idle boring code will not be shared! Bad writing, sorry to show you (embarrassed)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.