jQuery 删除类问题
我这里有一点问题: 我有以下 js 函数:
function setRounded(divId){
$(divId).addClass("rounded-corners");
}
function unsetRounded(divId){
$(divId).removeClass("rounded-corners");
}
这两个函数在事件之前和之后调用:例如我有以下页面:测试页面 我想在翻转块时删除圆角,但它不会发生。有刷新方法吗?我凝视了一下,但没有任何相似之处。
问候, 索林!
I have a little bit of problem here:
I have the following js functions:
function setRounded(divId){
$(divId).addClass("rounded-corners");
}
function unsetRounded(divId){
$(divId).removeClass("rounded-corners");
}
This two functions are called before and after an event: for example I have the following page:Testing page and i want to remove the rounded corners when i flip the block but it doesn't happen. Is there any refresh method ? I goggled a little bit but nothing similar.
Regards,
Sorin!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的代码几乎是正确的,实际上该类已从 div 中删除。然而,翻转插件似乎创建了一个 div 的副本来创建翻转效果,并且该 div 的副本仍然具有该类。
您可以尝试在调用 .flip 之前删除该类,而不是使用 onBefore。
Your code is almost correct, in fact the class is removed from the div. However the flip plugin seems to create a copy of the div to create the flipping effect, and that copy of the div still has the class.
You could try to remove the class before calling .flip on it, instead of using onBefore.
它在 Firefox 6.0 中的行为非常不一致。您是否尝试过将:更改
为:
It behaves very inconsistently in Firefox 6.0. Have you tried changing:
to: