Mercurial Hosting > dad
comparison src/examples/simple.html @ 3:6d5e4b38b4fb
start drag
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Fri, 21 Apr 2023 00:58:31 -0600 |
| parents | |
| children | 332d3e280f7e |
comparison
equal
deleted
inserted
replaced
| 2:264646feb67b | 3:6d5e4b38b4fb |
|---|---|
| 1 <!doctype html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| 5 <style> | |
| 6 @import "/site.css"; | |
| 7 @import "/dad.css"; | |
| 8 | |
| 9 span[drag] { | |
| 10 display: inline-block; | |
| 11 background-color: LightGreen; | |
| 12 padding: 8px; | |
| 13 } | |
| 14 </style> | |
| 15 <script src="/dad.js"></script> | |
| 16 <script> | |
| 17 function init() { | |
| 18 let span = document.querySelector('span[drag]'); | |
| 19 dad.setDraggable(span); | |
| 20 } | |
| 21 </script> | |
| 22 </head> | |
| 23 <body> | |
| 24 <h1>Simple</h1> | |
| 25 <p><span drag>drag me</span></p> | |
| 26 <p>bottom</p> | |
| 27 </body> | |
| 28 <script> init(); </script> | |
| 29 </html> |
