问题
As i need to code html in my software so i need only pure javascript
for fliping.
Please no css animation or Jquery animation, only pure javascript.
need similar to : http://pingmin-tech.com/flipcardjs
found one solution here : DEMO
but it will be better if i get similar to http://pingmin-tech.com/flipcardjs
回答1:
javascript before your html code.
and this link is the answer your asked me below comments: https://jsfiddle.net/ws7054r2/
#card {
display: block;
width: 50px;
height: 50px;
padding: 25px;
background-color: black;
color: white;
font-family: 'Arial', sans-serif;
}
<script>
var k = 0;
function flip() {
var j = document.getElementById("card");
k += 180;
j.style.transform = "rotatey(" + k + "deg)";
j.style.transitionDuration = "0.5s"
}
</script>
<div id="card" onmouseover="flip()">sample text</div>
回答2:
Buddy if you want the same thing as given in the link then you must use the jQuery file and the given css.
What is the problem in using the files?
The link you have provided has full code and demo on performing what you want, just use it.
It is much better as compared to any other alternate way to achieve what you want.
来源:https://stackoverflow.com/questions/28492791/pure-javascript-for-image-or-div-flip