mirror of
https://github.com/servo/servo
synced 2026-04-29 02:47:55 +02:00
20 lines
1.1 KiB
HTML
20 lines
1.1 KiB
HTML
<!doctype html>
|
|
<title>drag & drop - dragging elements by text that extends out of them</title>
|
|
<style type="text/css">
|
|
div {
|
|
height: 200px;
|
|
width: 200px;
|
|
background: blue;
|
|
white-space: nowrap;
|
|
}
|
|
</style>
|
|
<script type="text/javascript">
|
|
window.onload = function () {
|
|
document.getElementsByTagName('div')[0].ondragstart = function (e) {
|
|
e.dataTransfer.effectAllowed = 'copy';
|
|
e.dataTransfer.setData('text','dummy text');
|
|
};
|
|
};
|
|
</script>
|
|
<div draggable="true"> Drag me</div>
|
|
<p>Drag the above text sideways. Pass if the drag placeholder shows that both the text and blue square are being dragged.</p> |