src/cm/media/js/lib/yui/yui3.0.0/examples/dd/drag-plugin_clean.html
author Yves-Marie Haussonne <ymh.work+github@gmail.com>
Fri, 09 May 2014 18:35:26 +0200
changeset 656 a84519031134
parent 0 40c8f766c9b8
permissions -rw-r--r--
add link to "privacy policy" in the header test


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Drag Node Plugin</title>

<style type="text/css">
/*margin and padding on body element
  can introduce errors in determining
  element position and are not recommended;
  we turn them off as a foundation for YUI
  CSS treatments. */
body {
	margin:0;
	padding:0;
}
</style>

<link type="text/css" rel="stylesheet" href="../../build/cssfonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yui/yui-min.js"></script>

<!--there is no custom header content for this example-->

</head>

<body class=" yui-skin-sam">

<h1>Drag Node Plugin</h1>

<div class="exampleIntro">
	<p>This example shows using the Drag Node Plugin.</p>
			
</div>

<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->

<style>
    #demo {
        height: 100px;
        width: 100px;
        border: 1px solid black;
        background-color: #8DD5E7;
        position: relative;
        padding: 7px;
    }
    #demo h2 {
        padding: 0;
        margin: 0;
        position: absolute;
        top: 5px;
        right: 5px;
        font-size: 110%;
        color: black;
        font-weight: bold;
        cursor: move;
    }
</style>

<div id="demo"><h2>x</h2>Drag Me</div>

<script>

YUI({base:"../../build/", timeout: 10000}).use('dd-plugin', function(Y) {
    var node = Y.get('#demo');
    node.plug(Y.Plugin.Drag);
    node.dd.addHandle('h2');
});
</script>

<!--END SOURCE CODE FOR EXAMPLE =============================== -->

</body>
</html>