By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,116 Members | 1,319 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,116 IT Pros & Developers. It's quick & easy.

drag and image and browse image when click on image and display it

P: 1
i have developed a drag and clone of image.now in that i want that when click on image it display browse dialog box for browse image from computer.and after selecting image it display on that particular image tag.i am using jquery drag and drop plugin in php.below is my drag and drop code.

javascript:

Expand|Select|Wrap|Line Numbers
  1. <script>
  2.  
  3. $(function() {
  4. $( "#accordion" ).accordion();
  5. });
  6.  
  7.     $(".draggable").draggable({
  8.         helper: 'clone'
  9.     });
  10.     $(".drop-zone").droppable({
  11.         accept: '.draggable',
  12.         drop: function(event, ui) {
  13.             var $clone = ui.helper.clone();
  14.             if (!$clone.is('.inside-drop-zone')) {
  15.                 $(this).append($clone.addClass('inside-drop-zone').draggable({
  16.                     containment: '.drop-zone'
  17.                 }));
  18.  
  19.                 $clone.resizable({ //this works but I dont want it to on outside elements
  20.                     helper: "ui-resizable-helper"
  21.                 });
  22.  
  23.             }
  24.         }
  25. });
  26.  
  27. </script>

html code:

Expand|Select|Wrap|Line Numbers
  1. <img class="draggable" alt="image"/> <div class="drop-zone"> </div>
Oct 2 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.