www.webdeveloper.com
Results 1 to 2 of 2

Thread: JavaScript Button

  1. #1
    Join Date
    Nov 2012
    Posts
    1

    JavaScript Button

    I have been messing around with this "barrel roll" script and I was wondering how to have it as a button so it only worked when someone clicks it rather than starting immediately when the page opens and not stopping… here is the script, how can I make it a button?
    (function()%7Bvar%20s=document.createElement('style');s.innerHTML='@-moz-keyframes%20roll%20%7B%20100%25%20%7B%20-moz-transform:%20rotate(360deg);%20%7D%20%7D%20@-o-keyframes%20roll%20%7B%20100%25%20%7B%20-o-transform:%20rotate(360deg);%20%7D%20%7D%20@-webkit-keyframes%20roll%20%7B%20100%25%20%7B%20-webkit-transform:%20rotate(360deg);%20%7D%20%7D%20body%7B%20-moz-animation-name:%20roll;%20-moz-animation-duration:%204s;%20-moz-animation-iteration-count:%201;%20-o-animation-name:%20roll;%20-o-animation-duration:%204s;%20-o-animation-iteration-count:%201;%20-webkit-animation-name:%20roll;%20-webkit-animation-duration:%204s;%20-webkit-animation-iteration-count:%201;%20%7D';document.getElementsByTagName('head')%5B0%5D.appendChild(s);%7D());

  2. #2
    Join Date
    Aug 2012
    Posts
    43
    doh, can you layout your script?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles