Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

93 lines (81 sloc) 1.714 kb
<!DOCTYPE html>
<html>
<head>
<title>ROAR!</title>
<script src="lib/jquery.js"></script>
<script src="src/jquery.dragon.js"></script>
<style>
.dragon {
float: left;
height: 100px;
width: 100px;
}
#dragon-basic {
background: #f00;
}
#dragon-x {
background: #00f;
}
#dragon-y {
background: #0f0;
}
#dragon-container {
border: dotted 1px #000;
height: 300px;
position: absolute;
top: 120px;
width: 300px;
}
#dragon-contained {
background: #0ff;
}
#dragon-handle {
background: #ff8;
}
</style>
</head>
<body>
<div id="dragon-container">
<div id="dragon-contained" class="dragon">
<p>Drag me within my bounds!</p>
</div>
</div>
<div id="dragon-basic" class="dragon">
<p>Drag me anywhere!</p>
</div>
<div id="dragon-x" class="dragon">
<p>Drag me left and right!</p>
</div>
<div id="dragon-y" class="dragon">
<p>Drag me up and down!</p>
</div>
<div id="dragon-handle" class="dragon">
<p>Drag me by my text!</p>
</div>
<script>
$('#dragon-handle').dragon({
'handle': 'p'
});
$('#dragon-y').dragon({
'axis': $.fn.dragon.AXIS_Y
});
$('#dragon-x').dragon({
'axis': $.fn.dragon.AXIS_X
});
$('#dragon-basic').dragon({
'onDragStart': function (evt) {
console.log('Drag start.');
}
,'onDrag': function (evt) {
console.log('Dragging.');
}
,'onDragEnd': function (evt) {
console.log('Drag end.');
}
});
$('#dragon-contained').dragon({
'within': $('#dragon-container')
});
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.