获取jquery.SimpleModel和jquery之间的冲突
在我的asp.net mvc 3应用程序中,我有一个使用jquery.SimpleModel插件的弹出式动画。下面是负责动画的代码获取jquery.SimpleModel和jquery之间的冲突,jquery,asp.net-mvc-3,jquery-mobile,Jquery,Asp.net Mvc 3,Jquery Mobile,在我的asp.net mvc 3应用程序中,我有一个使用jquery.SimpleModel插件的弹出式动画。下面是负责动画的代码 $.modal(data, { containerId: 'popupdiv', opacity: 5, autoResize: true, overlayCss: { backgroundColor: "#000" }, onShow: function () { initSwitchToLatest() }, onOpen: function (dial
$.modal(data, {
containerId: 'popupdiv',
opacity: 5,
autoResize: true,
overlayCss: { backgroundColor: "#000" },
onShow: function () {
initSwitchToLatest()
},
onOpen: function (dialog) {
dialog.overlay.fadeIn(0, function () {
var h = $("#popupdiv").height();
var w = $("#popupdiv").width();
var l = $("#popupdiv").css("left");
var t = $("#popupdiv").css("top");
dialog.container.fadeIn('fast', function () {
if ($.browser.msie) {
$('.popup').css('behavior', 'none');
}
$('#popupdiv').css('opacity', 0);
dialog.data.height(0);
dialog.data.width(0);
$(".popup").width(0);
$("#popupdiv").css("left", popup_mouse_x + "px");
$("#popupdiv").css("top", popup_mouse_y + "px");
dialog.data.show();
$(".popup").animate({ "width": w, "height": "auto" }, 500);
dialog.data.animate({ "height": h, "width": w }, 500);
$("#popupdiv").animate({ "left": l, "top": t, "opacity": 1 }, 500, function () {
$("#loading-mask").show();
if ($.browser.msie) {
$('.popup').css('behavior', 'url(../../../Scripts/PIE.htc)');
}
ReplacePopupContents($("#popupContentUrl").val());
});
});
});
}
});
现在我尝试使用jquery移动滚动效果,但如果我将这两个插件一起调用,如下所示:
<script src="@Url.Content("~/Scripts/jquery.simplemodal-1.4.2.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.js")" type="text/javascript"></script>
弹出的动画不会出现
PS:这个错误只有在我调用第二个插件时才会出现。您好,您必须在简单模式文件之前包含jquery文件。像这样
<script src="@Url.Content("~/Scripts/jquery.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.simplemodal-1.4.2.js")" type="text/javascript"></script>
谢谢您的回复,但这样我就失去了滚动效果。您是否向firebug检查了文件是否包含在内?如果您仍然有问题,请尝试使用关键字jQuery而不是“$”,如果您认为存在冲突,那么我得到了相同的结果,TypeError:jQuery.modal不是一个函数。我和firebug核对过了,文件都包括在内了
<script src="@Url.Content("~/Scripts/jquery.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.simplemodal-1.4.2.js")" type="text/javascript"></script>