0

Hello everyone i have a lot of problems to make my picture resizable (when i put my pointer on the edges of the picture) using Angular js can anyone please help me how can i make script functional?. Here is my Html ...

<div class="container">

  <div class="row">
    <div class="col-sm-8 ">


     <img class="img-responsive " src="assets/images/coca-cola.jpg" alt="" />


      </div>
    </div>
  </div>
4
  • what do you mean resizable? real time update ? Commented Jun 3, 2016 at 7:23
  • i like to resize my picture when i move my mouse cursor on some edge of the picture. tnx Commented Jun 3, 2016 at 7:27
  • you reject my edit? :3 Commented Jun 3, 2016 at 7:28
  • no can you post again. Commented Jun 3, 2016 at 7:29

1 Answer 1

1

Simplest way is using CSS resize property.

<div style="overflow:auto;resize:both;">
    <img style="width:100%;height:auto;" class="img-responsive " src="assets/images/coca-cola.jpg" alt="" />
</div>

Then you can use ng-mouseover to trigger that style or class using ng-style or ng-class

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Jack it work good but i have little problem because picture is in <div> and i resize "div" not picture
The image size is set to 100% width of its parent. Whe you change the wrapper div's size, image changes correspondingly. If you want to literally resize image, I suggest using canvas, please see stackoverflow.com/questions/19100009/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.