【发布时间】:2011-10-12 21:09:53
【问题描述】:
我正在尝试将两个 Jquery 移动插件结合在一起。两者都使用相同的核心功能,但其中一个添加了一个选项,这使另一个插件无法工作。
函数是这样调用的:
$.mobile.changePage(
url,
{
type: type && type.length && type.toLowerCase() || "get",
data: $this.serialize(),
transition: $this.jqmData("transition"),
direction: $this.jqmData("direction"),
reloadPage: true,
pageContainer:$currPanel
}
);
pageContainer 只被一个函数使用。
我的问题: 有没有办法区分选项还是我必须做这样的事情:
if (called by plugin one) {
function with option
} else if (called by plugin two){
function without option
}
一定有更好的方法来做到这一点?
感谢您的意见!
【问题讨论】:
标签: jquery function jquery-mobile options