How to execute an function if something is dragged?

Discussion in 'jQuery' started by kuser, Dec 29, 2012.

  1. #1
    I made this code.
    
    
      $(function() {
            $( "#xcontainer" ).sortable({
                cursor: 'pointer',
                revert: true
            });
    
            $("div" ).disableSelection();
        }); 
    
    
    Code (markup):
    The problem is that i also wish to do something like document.getElementBy("msg").innerHTML = " Updated " if the user wish to drag an element.
     
    kuser, Dec 29, 2012 IP
  2. artus.systems

    artus.systems Well-Known Member

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    103
    #2
    Can you try this

      $(function() {
            $( "#xcontainer" ).sortable({
                cursor: 'pointer',
                revert: true,
                stop: function() { alert('stopped');}
            });
    
            $("div" ).disableSelection();
        });
    Code (markup):
     
    artus.systems, Jan 15, 2013 IP