3

i was just wondering if i could make a form slide when the page loads

 <!DOCTYPE html>
 <html>
 <head>
 <link rel="stylesheet" href="css/gi.css">

 </head>
 <body onload='document.getElementById("form1").style["-webkit-transform"] = "translateX(100px);"'>
 <form action='gi.php' method='post' id='form1'>
 <!-- form elements -->
</form>
</body>
</html>

that's the code im working on

note: this html will be placed inside an iframe

any responses would be appreciated

0

1 Answer 1

2

You can try something like this

form {
  transform: translateX(1000px);
  -webkit-animation: move 2s forwards;
}
@-webkit-keyframes move {
  100% {
    transform: translateX(0)
  }
}
<form action='gi.php' method='post' id='form1'>
  <input type="button" value="button">
  <input type="button" value="button">
  <input type="button" value="button">
  <input type="button" value="button">
  <input type="button" value="button">
  <input type="button" value="button">
</form>

Sign up to request clarification or add additional context in comments.

3 Comments

thanks Akshay for the answer will that code run when the page loads ??
@YesSir Yes you can try the snippet
Hey dude thanks i just tried the code you gave it works fine ^-^ thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.