
ajax更新后,jquery事件失效。浏览器第一次加载 能够正确执行,点击按钮加载Ajax数据后,事件失效
浏览器第一次加载能够正确执行,点击按钮加载Ajax数据后(jquery的选择器为a标签预约此项目为新的ajax数据),事件失效<scripttype="text/java...
浏览器第一次加载 能够正确执行,点击按钮加载Ajax数据后(jquery的选择器为a标签预约此项目为新的ajax数据),事件失效
<script type="text/javascript">
$(function () {
$(".ck-ap").Junalert({
Widht: 450,
Height: 150,
CloseId: "close",
BoxID: "yusjs_Alert"
});
});
</script>
/*
*插件
*
*/
var J = null;
var isWindow = true;
(function ($) {
$.fn.extend({
Junalert: function (O) {
O = $.extend({
BoxID: 'boxContent',
Widht: 476,
Height: 145,
Shade: true,
CloseId: "close",
ConfirmId: "qd",
Palytime: 400,
callback: null
}, O);
J = {
Whdss: function () {
var left = ($(window).width() - O.Widht) / 2,
top = ($(window).height() - O.Height) / 2;
$("#" + O.BoxID).css({ "top": top, "left": left });
}, boxAlart: function () {
if (O.Shade) $("#" + O.BoxID).parent().prepend("<div class='shade_bg'></div>");
J.Whdss();
$('.shade_bg').css({ "position": "fixed", "_position": "absolute", "top": 0, "left": 0, "width": "100%", "height": "100%", "background": "#fff", "opacity": 0.3, "z-index": 1100, "filter": "alpha(opacity=30)" });
$("#" + O.BoxID).css({ "display": "block", "position": "fixed", "width": O.Widht, "height": O.Height, "z-index": 10000 });
$(window).bind("resize", function () {
J.Whdss();
});
}, close: function () {
$(".shade_bg").fadeOut(function () {
$(this).remove();
});
$("#" + O.BoxID).removeAttr("style").css({ "display": "none" });
}
}
$(this).bind("click", function () {
if (isWindow) {
J.boxAlart();
}
});
$("." + O.CloseId + ",.cls").bind("click", function () {
J.close();
});
$("." + O.ConfirmId).bind("click", function () {
if (O.callback) O.callback();
J.close();
});
}
});
})(jQuery); 展开
<script type="text/javascript">
$(function () {
$(".ck-ap").Junalert({
Widht: 450,
Height: 150,
CloseId: "close",
BoxID: "yusjs_Alert"
});
});
</script>
/*
*插件
*
*/
var J = null;
var isWindow = true;
(function ($) {
$.fn.extend({
Junalert: function (O) {
O = $.extend({
BoxID: 'boxContent',
Widht: 476,
Height: 145,
Shade: true,
CloseId: "close",
ConfirmId: "qd",
Palytime: 400,
callback: null
}, O);
J = {
Whdss: function () {
var left = ($(window).width() - O.Widht) / 2,
top = ($(window).height() - O.Height) / 2;
$("#" + O.BoxID).css({ "top": top, "left": left });
}, boxAlart: function () {
if (O.Shade) $("#" + O.BoxID).parent().prepend("<div class='shade_bg'></div>");
J.Whdss();
$('.shade_bg').css({ "position": "fixed", "_position": "absolute", "top": 0, "left": 0, "width": "100%", "height": "100%", "background": "#fff", "opacity": 0.3, "z-index": 1100, "filter": "alpha(opacity=30)" });
$("#" + O.BoxID).css({ "display": "block", "position": "fixed", "width": O.Widht, "height": O.Height, "z-index": 10000 });
$(window).bind("resize", function () {
J.Whdss();
});
}, close: function () {
$(".shade_bg").fadeOut(function () {
$(this).remove();
});
$("#" + O.BoxID).removeAttr("style").css({ "display": "none" });
}
}
$(this).bind("click", function () {
if (isWindow) {
J.boxAlart();
}
});
$("." + O.CloseId + ",.cls").bind("click", function () {
J.close();
});
$("." + O.ConfirmId).bind("click", function () {
if (O.callback) O.callback();
J.close();
});
}
});
})(jQuery); 展开
展开全部
你发上来的代码跟ajax 一点关系都没有啊. 貌似就是一个模拟弹窗的效果..
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询