Mercurial Hosting > dad
comparison src/examples/handle.html @ 7:332d3e280f7e
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 23 Apr 2023 20:46:17 -0600 |
parents | 6d5e4b38b4fb |
children |
comparison
equal
deleted
inserted
replaced
6:4d699321068f | 7:332d3e280f7e |
---|---|
4 <meta name="viewport" content="width=device-width, initial-scale=1"> | 4 <meta name="viewport" content="width=device-width, initial-scale=1"> |
5 <style> | 5 <style> |
6 @import "/site.css"; | 6 @import "/site.css"; |
7 @import "/dad.css"; | 7 @import "/dad.css"; |
8 | 8 |
9 span[handle] { | 9 [handle] { |
10 display: inline-block; | 10 display: inline-block; |
11 background-color: LightGreen; | 11 background-color: LightGreen; |
12 padding: 8px; | 12 padding: 8px; |
13 } | 13 } |
14 span[outer] { | 14 [outer] { |
15 display: inline-block; | 15 display: inline-block; |
16 background-color: LightBlue; | 16 background-color: LightBlue; |
17 padding: 8px; | 17 padding: 8px; |
18 } | 18 } |
19 </style> | 19 </style> |
22 dad.whatToDrag = function(draggable) { | 22 dad.whatToDrag = function(draggable) { |
23 return draggable.parentNode; | 23 return draggable.parentNode; |
24 }; | 24 }; |
25 | 25 |
26 function init() { | 26 function init() { |
27 let span = document.querySelector('span[handle]'); | 27 let handle = document.querySelector('[handle]'); |
28 dad.setDraggable(span); | 28 dad.setDraggable(handle); |
29 } | 29 } |
30 </script> | 30 </script> |
31 </head> | 31 </head> |
32 <body> | 32 <body> |
33 <h1>Handle</h1> | 33 <h1>Handle</h1> |