Add all the A tasks
This commit is contained in:
parent
2dd7375f96
commit
051504d65b
1608 changed files with 18584 additions and 0 deletions
23
Task/Animation/JavaScript/animation.js
Normal file
23
Task/Animation/JavaScript/animation.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="100" height="40">
|
||||
<script type="text/javascript">
|
||||
function animate(element) {
|
||||
var textNode = element.childNodes[0]; // assuming no other children
|
||||
var text = textNode.data;
|
||||
var reverse = false;
|
||||
|
||||
element.onclick = function () { reverse = !reverse; };
|
||||
|
||||
setInterval(function () {
|
||||
if (reverse)
|
||||
text = text.substring(1) + text[0];
|
||||
else
|
||||
text = text[text.length - 1] + text.substring(0, text.length - 1);
|
||||
textNode.data = text;
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
||||
|
||||
<rect width="100" height="40" fill="yellow"/>
|
||||
<text x="2" y="20" onload="animate(this);">Hello World! </text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 802 B |
Loading…
Add table
Add a link
Reference in a new issue