Jump to content

Triggering animations


helloworld
 Share

Recommended Posts

Hi guys.  I found this playground.  It doesn't have animation, but it shows how to create an HTML button using scene-code JS. 

It uses onclick, but has eventListener examples, too.  You could change "span" to "button" in line 33, if you wish.  *shrug*

Might be handy for you, HW.  You could put animation-start command... at line 49.

Creating absolutely-positioned HTML buttons... within scene JS code... takes many lines of JS...  but it is fun/powerful.  Hope this helps.

Link to comment
Share on other sites

Good to hear!  Yeah, sometimes there is a "scope" problem with HTML onclick="somefunc".  Sometimes it can be fixed by using onclick = "window.somefunc".  I'm no professional.  :)

Your animation is working - I'm glad.  Nice to know there is no problem with animation part.  Only HTML part.  :)

Also, welcome to the forum - good to have you with us.

Link to comment
Share on other sites

also it would be great if you could help me out somemore

after this animation plays i want to then play the next animation how would i do that (with the same button)?

edit: ive played around with this

function addItem() {
var newItem = document.createElement("span");
newItem.innerHTML = document.getElementById("ms123").value;
newItem.onclick = removeItem;
document.getElementById("list").appendChild(newItem);
}
 
function removeItem() {
document.getElementById("ms123").removeChild(this);
}
 
but so far it hasnt worked (ms123 is the previous span)
 
if you want me to send you the whole file just say
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...