Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<link class="jsbin" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script><script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  #hello {cursor: pointer }
</style>
</head>
<body>
  <p id="hello">Drag this</p>
  <b id=test>Here pageX and pageY will show</b>
</body>
</html>
 
$(function() {
  $('#hello').draggable({
      helper: 'clone',
      appendTo: 'body',
      start:function(e,ui){
        $(this).css('opacity', 0.6);
      },
      stop:function(e,ui){
        $(this).css('opacity', 1);
        $('#test').html(e.pageX+','+e.pageY);
      }
    });
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers