这是HTML的jQuery DIV翻转
<article class="post">
<div class="post-inner">
<div class="post-content">
// stuff here
<button class="order">Order</button>
</div>
<div class="post-content-back">
// stuff here
<button class="back">Back</button>
</div><!--/.post-back -->
</div>
</article>
我使用这个flippy plugin翻转正面和背面的意见,但它只是不适合某些原因,我不工作:
jQuery(".post .order").bind("click",function(e){
e.preventDefault();
jQuery(this).parents(".post-content").flippy({
content:jQuery(this).next().find(".post-content-back"),
direction:"LEFT",
duration:"750",
onStart:function(){
alert("Let's flip");
},
onFinish:function(){
alert("ok, it's flipped :)");
}
});
});
在控制台中是否有任何错误(在大多数浏览器中按f12) – amd
@Ahmad没有任何错误。 – 3zzy
我收到了一个JavaScript错误'未捕获的ReferenceError:g没有定义'使用此代码 - 请参阅我的答案,这解释了为什么 – andyb