shani622 / jquery-rotate

Automatically exported from code.google.com/p/jquery-rotate
0 stars 0 forks source link

Jquery containment problem with Image rotation RSS #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
HI All. I am using the below code to rotate the drag/dropped image.The rotation 
is working fine,but when i start rotating ,the image moves outside the "div" 
container .Anything i am missing.

//Moving outside the container for first time.After dragging inside the 
div,then rotates inside the div 
  var test = 5; 
  var mouseDown = false; 
  $(function() { 
      $('.frame').mousedown(function(e) { mouseDown = true; }); 
      $('.frame').mouseup(function(e) { mouseDown = false; }); 
      $('.frame .rotatable').live('mousemove', function(e) { 
          if ((mouseDown) && (e.ctrlKey)) { 

              test = test + 10; 
              var currentId; 
              document.getElementById('angle').value = test; 
              $(this).rotate({ angle: test }); 
              var currentId = $(this).attr('id'); 
              var id = currentId.substring(8);                   
              var deleteimage = 0; 
              var angle = test; 
              saveCoords(e.clientX, e.clientY, angle, id, document.getElementById("<%=trafficID.ClientID%>").value, deleteimage); 
          } 
          $('#frame .rotatable').draggable({ containment: 'parent' }); //throwing out of the div
 //instead if i use resizable,the position is maintained but the corners are cropped.
// $('#frame .rotatable').resizable({ autoHide: true }).parent().draggable({ 
containment: 'parent' });

      }); 
  }); 
<div id="frame" class="frame" runat="server"  style="width:550px; 
height:400px;background-position:bottom; border:1px solid #000;"></div>

What is the expected output? What do you see instead?
The image is thrown out of the div "frame" during first time rotation .Then i 
am dragging it to the div and following rotation works perfectly .

What version of the product are you using? On what operating system?
I am using windows XP, IE7 , 
http://wilq32.adobeair.pl/jQueryRotate/Wilq32.jQueryRotate.html,Jquery.1.4.js

Original issue reported on code.google.com by vani36...@gmail.com on 17 Feb 2011 at 3:23