Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9223949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:11:49+00:00 2026-06-18T04:11:49+00:00

Hello i’m trying to figure out how to trigger a css3 animation with javascript,

  • 0

Hello i’m trying to figure out how to trigger a css3 animation with javascript, for some reason my code isnt working…` my jfiddle can be seen here http://jsfiddle.net/sean3200/RE6K6/

CSS:

<style>
#div1
{
position: relative;
height: 150px;
width: 150px;
margin: 50px;
padding:10px;
border: 1px solid black;
perspective:150;
-webkit-perspective:150; /* Safari and Chrome */
}

#div2
{
padding:50px;
position: absolute;
border: 1px solid black;
background-color: red;
transform: rotateX(45deg);
-webkit-transform: rotateX(45deg); /* Safari and Chrome */
}
</style>

JavaScript:

<script type="text/javascript">
function myBtn() {
    var btn = document.getElementById('div1').style.webkitPerspective=500;

}
</script>

HTML Elements:

<button onclick="myBtn()">Move Me</button>
<div id="div1">HELLO</div>
<div id="div2">HELLO</div>
<div id="div3">HELLO</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:11:50+00:00Added an answer on June 18, 2026 at 4:11 am

    You need to nest your divs for perspective to work:

    <div id="div1">HELLO</div>
    <div id="div2">HELLO</div>
    

    Needs to be:

    <div id="div1">
        <div id="div2">HELLO</div>
    </div>
    

    Also, run your js in the head not onload for your fiddle to acknowledge your click event:

    http://jsfiddle.net/RE6K6/2/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello all I am working on javascript jquery and svg.I want to ask a
Hello all I am working on html and javascript.And I am going to ask
Hello I am trying to do a SOAP request here is my code: #
Hello I'm trying to add MapView to LinearLayout this is my code: GoogleMap mMap
Hello guys I'm trying to centre some images. They keep on floating to the
hello all i am working on a project in which i have a webpage
Hello I use the following code in order to retrieve an events infoormation from
Hello all and a Happy New Year SITUATION: I have some tables in MySQL
Hello i'm trying create an application allowing me host any kind of file. In
Hello I want to collect output of following command into some variable.How can I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.