與「css供應商前綴」一起奮鬥,但無法讓它在所有設備上都能正常工作。所以,現在,讓我們試試一個名爲jQuery flip的jQuery解決方案。需要「懸停」和「點擊」,但觸發「手冊」,根據文件,以通過JavaScript激活這裏找到:X秒後執行jQuery翻轉
它完美的作品上觸發http://nnattawat.github.io/flip/
所以我的問題:我如何寫一個javascript在3秒後啓用翻轉功能?
CODE:
<head>
<style type="text/css">
.card {
width: 600px;
height: 400px;
margin: 20px;
}
.front, .back {
border: 2px gray solid;
padding: 10px;
}
.front {
background-color: #ccc;
}
.back {
background-color: red;
}
</style>
</head>
<body>
<div id="card-1" class="card">
<div class="front">
Front: Cursus aliquet mus et sociis, placerat adipiscing a placerat magnis integer nisi lacus in, turpis porttitor? Lectus nunc dis in porta, montes lacus. Tortor. Pid sit nisi eu nec aenean.
</div>
<div class="back">
<a href="http://google.com">link</a>
Back: Dolor scelerisque ridiculus! Mus? Augue, montes, montes proin rhoncus vel a parturient dapibus eros? Penatibus nascetur. In turpis nisi elementum nascetur habitasse augue egestas, in ac rhoncus odio porttitor turpis.
</div>
</div>
<script type="text/javascript">
$(function(){
// $(".card").flip();
$("#card-1").flip({
axis: "y", // y or x
reverse: false, // true and false
trigger: "manual", // click, hover or manual
speed: 500
});
});
</script>
</body>
提前感謝!
http://jsfiddle.net/zdapLrbs/2/ –