Py学习  »  Andrew Hare  »  全部回复
回复总数  1
15 年前
回复了 Andrew Hare 创建的主题 » jquery开关盒插件?

正常人怎么了 if/else ?

inst = $(this);

if (inst.hasClass('foo')) {
    // do something
} else if (inst.filter('.bar').attr('id') == 'foo') {
    // do something else
}