Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#apple1").click(
- function myMove() {
- $("#apple1").animate({
- top: "84%",left:Math.floor(Math.random() * 4) +22 + '%'
- }, 300)
- })
- $("#apple2").click(
- function myMove() {
- $("#apple2").animate({
- top: "83%",left:Math.floor(Math.random() * 4) +22 + '%'
- }, 300)
- })
- $("#apple3").click(
- function myMove() {
- $("#apple3").animate({
- top: "85%",left:Math.floor(Math.random() * 4) +22 + '%'
- }, 300)
- })
- <img src="images/apple.png" class="apple" id="apple1" alt="apple" style= "top: 40%; left: 60%;" >
- <img src="images/apple.png" class="apple" id="apple2" alt="apple" style= "top: 40%; left: 70%;" >
- <img src="images/apple.png" class="apple" id="apple3" alt="apple" style= "top: 50%; left: 60%;">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement