OLD | NEW |
1 --- | 1 --- |
2 layout: default | 2 layout: default |
3 title: Moving elements within the DOM tree | 3 title: Moving elements within the DOM tree |
4 live_example_url: /docs/tutorials/add-elements/examples/anagram/anagram.html"> | 4 live_example_url: /docs/tutorials/add-elements/examples/anagram/anagram.html"> |
5 header: | 5 header: |
6 css: ["/samples/samples.css"] | 6 css: ["/samples/samples.css"] |
7 --- | 7 --- |
8 | 8 |
9 ## {{ page.title }} | 9 ## {{ page.title }} |
10 | 10 |
11 Form a word by clicking the letter tiles. | 11 Form a word by clicking the letter tiles. |
12 | 12 |
13 This app shows how to programmatically move an element on the page. | 13 This app shows how to programmatically move an element on the page. |
14 | 14 |
15 To move an element on the page, change its parent element. An element can have | 15 To move an element on the page, change its parent element. An element can have |
16 only one parent, so changing the parent moves the element in the DOM tree. In | 16 only one parent, so changing the parent moves the element in the DOM tree. In |
17 this example, when you click on a tile, the click handler changes the tile’s | 17 this example, when you click on a tile, the click handler changes the tile’s |
18 parent. | 18 parent. |
19 | 19 |
20 Read this [tutorial](/docs/tutorials/add-elements/#moving-elements) for | 20 Read this [tutorial](/docs/tutorials/add-elements/#moving-elements) for |
21 more detail, or read the | 21 more detail, or read the |
22 [source](https://github.com/dart-lang/dart-tutorials-samples/tree/master/web/ana
gram). | 22 [source](https://github.com/dart-lang/dart-tutorials-samples/tree/master/web/ana
gram). |
23 | 23 |
24 <iframe class="running-app-frame" | 24 <iframe class="running-app-frame" |
25 style="height:400px;width:40%;" | 25 style="height:400px;width:40%;" |
26 src="{{page.live_example_url}}"> | 26 src="{{page.live_example_url}}"> |
27 </iframe> | 27 </iframe> |
28 | 28 |
29 See all [samples](/samples/) | 29 See all [samples](/samples/). |
OLD | NEW |