www.webdeveloper.com
Results 1 to 2 of 2

Thread: User moves the cursor to this button, it should run away.

  1. #1
    Join Date
    May 2011
    Posts
    1

    User moves the cursor to this button, it should run away.

    I am new student. Trying for first time.

    Make a web page with a push button that says “Shoot me”, when the user moves the cursor to this button, it should run away.

    Thanks for any help

  2. #2
    Join Date
    Apr 2010
    Location
    Salem,Ma
    Posts
    623
    sounds like homework so I'm not going to write out some code until you give it a try yourself . you would want to position your button absolutely ( http://www.barelyfitz.com/screencast...s/positioning/ - see tab 3), create a javascript function that either A. changes the left and or top position ( http://www.css-resources.com/Change-...he-W3C-DOM.htm) using random numbers ( if you just want it to move around on the screen) or B. changes the position incrementally using a setInterval ( http://www.elated.com/articles/javas...d-setinterval/) so it will "run" off the screen , then add that function the the OnMouseOver ( http://www.w3schools.com/jsref/event_onmouseover.asp) property of your button

Thread Information

Users Browsing this Thread

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

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