Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
˜<!DOCTYPE html>
<html ng-app="test">
<head>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<meta charset=utf-8 />
<title>JS Bin</title>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
<script src="https://raw.github.com/EightMedia/hammer.js/v1.0.5/dist/jquery.hammer.min.js"></script>
  
</head>
<body>
  
  <div id="test" ng-controller="testcontroller">
    <ul>
      <li class="small" ng-repeat="l in list" id="list{{l}}" identifier="l" style="background-image:url('http://placekitten.com/200/300')"; something>{{l}}</li>
    </ul>
  </div>
  
</body>
</html>
 
angular.module("test",[]).controller("testcontroller",function($scope){
  $scope.list = [1,2,3,4,5];
}).directive("something",function(){
  return {
    restrict: "A",
    link: function(scope,element,attrs){
   Hammer(element).on("hold",function(event){
        console.log("hold");
        $(element).draggable({
                helper: "clone",
                cursorAt: { left: 5, top: -5 },
                cursor: "move",
                stop: function() {
                        $(element).draggable("destroy");
                }
        });
    });
    }   
  };
});    
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
lethalbrainpro
0viewers