How to rotate drag/dropped Image using Jquery
<p>I am having an issue in Jquery rotate  below is my HTML code</p>

<pre><code>&lt;div id="frame" style="height:100;width:100;" &gt;
&lt;img alt="" id="Img1" runat="server" src="~/Images/pdfcar.png"
style="height:30px;width:30px;"/&gt;    
</code></pre>

<p></p>

<p>The below code is working fine,</p>

<p>Javascript:Jquery rotate</p>

<pre><code> var test = 5;
 $(function() {
     $('#Img1').live('mousedown', function(event) {
              test = test + 15;
              **$('#Img1').rotate({ angle: test });**

     });
 });
</code></pre>

<p>But my scenario is to acheive the rotation of dropped images,when i try the below code its not working</p>

<pre><code>var test = 5;
 $(function() {
     $('#frame img').live('mousedown', function(event) {
              test = test + 15;
              **$('#frame img').rotate({ angle: test });**

     });
 });
</code></pre>

<p>What's wrong in the above code or how to achieve it??</p>

<p>Full JQuery code</p>

<pre><code>var counter = 1;
  $(function() {
  $('#frame img').live('click', function(event) {


          if ((counter &gt; 0) &amp;&amp; (counter &lt; 350)) {
              $(this).rotate(counter + 45);
              counter = counter + 45;
          }
          else if ((counter &gt; -1) &amp;&amp; (counter &gt; 350)) {

              counter = 1;
          }
      });

  });

  $(function() {

      $('#frame img').live('dblclick', function(ev, ui) {
      // $(this).resizable("destroy")

      $(this).hide();
      var currentId = $(this).attr('id');
      var deleteimage = 1;
      saveCoords(ev.clientX, ev.clientY, currentId, document.getElementById("&lt;%=trafficID.ClientID%&gt;").value, deleteimage);


          //$(this).unbind("resizable"); not working
          //$(this).removeclass(); not working
      });
  });



  $(document).ready(function() {
      //Counter
      counter = 0;

      //Make element draggable
      $("#fd img").draggable({
          helper: 'clone',
          containment: '#frame',
          //When first dragged
          stop: function(ev, ui) {           

              var pos = $(ui.helper).offset();
              objName = "#clonediv" + counter
              $(objName).css({ "left": pos.left, "top": pos.top });
              $(objName).removeClass("drag");
              //When an existiung object is dragged
              $(objName).draggable({
                  containment: 'parent',
                  stop: function(ev, ui) {
                      var pos = $(ui.helper).offset();
                      //console.log($(this).attr("id"));
                      //console.log(pos.left)
                      //console.log(pos.top)
                  }
              });
          }
      });
      //Make element droppable
      $("#frame").droppable({

      drop: function(ev, ui) {

              if (ui.helper.attr('id').search(/drag[0-9]/) != -1) {
                  var pos = $(ui.helper).offset();
                  counter++;
                  var element = $(ui.helper).clone();
                  //var element = element1.resizable();
                  element.addClass("tempclass");
                  $(this).append(element);
                  var deleteimage = 0; 
                  element.attr("id", ui.helper.attr('id') + counter);
                  saveCoords(ui.absolutePosition.left, ui.absolutePosition.top, ui.helper.attr('id') + counter, document.getElementById("&lt;%=trafficID.ClientID%&gt;").value, deleteimage);
                  $(".tempclass").attr("id", "clonediv" + counter); 
                  $("#clonediv" + counter).removeClass("tempclass"); 
                  //$(".tempclass").attr("onclick",function(){ $(this).remove(););
                  //$("#clonediv" + counter).removeClass("tempclass");
                  //Get the dynamically item id
                  draggedNumber = ui.helper.attr('id').search(/drag([0-9])/);
                  itemDragged = "dragged" + RegExp.$1;
                  //console.log(itemDragged)
                  //alert('left' + pos.left + ',top' + pos.top + 'of item' + itemDragged);
                  $("#clonediv" + counter).addClass(itemDragged);
              }
          }
      });
      //Make the element resizable


  });
</code></pre>
