Resize image with Javascript

Asked

Viewed 1,024 times

2

It would be possible to build with Javascript an image manipulation interface similar to that of Word, which has the option to enlarge the image or decrease with the mouse?

  • Resize to a fixed size in the code, or being the page’s own user to resize Word style?

  • being the page user himself to resize Word style

  • The very one jquery UI has functionality to it with $("#omeuimg").resizable();

  • guy didn’t work out

  • To work you must include the Jquery UI if it is not already doing so, as indicated in examples, which is different from normal Jquery only

1 answer

3


It’s a lot of work to do that manually. There is a CSS property that solves this, but only allows pulling to increase the image in the lower right corner, and still has limited support. But it’s interesting:

div {
  width: 200px;
  resize: both;
  overflow: auto;
}

img {
  width: 100%;
}
<div>
  <img src="https://tctechcrunch2011.files.wordpress.com/2015/04/codecode.jpg?w=738">
</div>
<p>Puxe o canto inferior direito da imagem</p>

To ensure full support and more functionality, only hand-building or using a library.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.