|
إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...
انضم الينا
#1
| ||
| ||
السلام عليكم أخواني الأعزاء ،، عندي مشكله صغيره و يا ليت مساعده كما تعرفون عند وجود اكثر من مكتبه Jquery في الكود تسبب تعطيل لوظائف اكواد الجافا سكربت بالصفحه ، لها طرق في حلها كما يعلم المتخصصون بذلك ، عموما انا اغلب مشكله أكواد الجافا سكربت التي بالصفحه قمت بحلها الا كود واحد لم أستطع حله و اتمنى من الخبراء التعاون معي : هذا هو كود الجافا سكربت قبل اي تعديل : رمز Code: /*Start Notification JS*/ (function (c) { var b = { inEffect: { opacity: "show" }, inEffectDuration: 600, stayTime: 5000, text: "", sticky: false, type: "notice", position: "top-right", closeText: "", close: null }; var a = { init: function (d) { if (d) { c.extend(b, d) } }, showToast: function (f) { var g = {}; c.extend(g, b, f); var j, e, d, i, h; j = (!c(".toast-container").length) ? c(" ").addClass("toast-container").addClass("toast-position-" + g.position).appendTo("body") : c(".toast-container"); e = c(" ").addClass("toast-item-wrapper"); d = c(" ").hide().addClass("toast-item toast-type-" + g.type).appendTo(j).html(c(" ").append(g.text)).animate(g.inEffect, g.inEffectDuration).wrap(e); i = c(" ").addClass("toast-item-close").prependTo(d).html(g.closeText).click(funct ion () { c().toastmessage("removeToast", d, g) }); h = c(" ").addClass("toast-item-image").addClass("toast-item-image-" + g.type).prependTo(d); if (navigator.userAgent.match(/MSIE 6/i)) { j.css({ top: document.documentElement.scrollTop }) } if (!g.sticky) { setTimeout(function () { c().toastmessage("removeToast", d, g) }, g.stayTime) } return d }, showNoticeToast: function (e) { var d = { text: e, type: "notice" }; return c().toastmessage("showToast", d) }, showSuccessToast: function (e) { var d = { text: e, type: "success" }; return c().toastmessage("showToast", d) }, showErrorToast: function (e) { var d = { text: e, type: "error" }; return c().toastmessage("showToast", d) }, showWarningToast: function (e) { var d = { text: e, type: "warning" }; return c().toastmessage("showToast", d) }, removeToast: function (e, d) { e.animate({ opacity: "0" }, 600, function () { e.parent().animate({ height: "0px" }, 300, function () { e.parent().remove() }) }); if (d && d.close !== null) { d.close() } } }; c.fn.toastmessage = function (d) { if (a[d]) { return a[d].apply(this, Array.prototype.slice.call(arguments, 1)) } else { if (typeof d === "object" || !d) { return a.init.apply(this, arguments) } else { c.error("Method " + d + " does not exist on jQuery.toastmessage") } } } })(jQuery); أقوم بادراج هذا الكود من أجل أن اظهار رساله للمستخدميين اقتباس: $().toastmessage('showToast', { text: 'Message Alert', sticky: true, position: 'top-right', type: 'success', closeText: '', }); طبعا أنا اعمل بتقنية Asp.net لذلك أقوم بصنع كود الجافا سكربت بالكود و اقوم بحقنها في وسوم HTML من أجل اظهار الرساله ، كانت تظهر بشكل جيد بدون مشاكل قبل التعارض في المكاتب : رمز Code: sb.AppendLine("$().toastmessage('showToast', {"); sb.AppendLine(" text: '" + Message + "',"); sb.AppendLine(" sticky: true,"); sb.AppendLine(" position: 'top-right',"); sb.AppendLine(" type: 'success',"); sb.AppendLine(" closeText: '',"); sb.AppendLine(" } طبعا بعد تعديلي للكود من أجل حل مشكلة التعارض أصبح بهذا الشكل : رمز Code: var $j = jQuery.noConflict(); /*Start Notification JS*/ $j(function (c) { var b = { inEffect: { opacity: "show" }, inEffectDuration: 600, stayTime: 5000, text: "", sticky: false, type: "notice", position: "top-right", closeText: "", close: null }; var a = { init: function (d) { if (d) { c.extend(b, d) } }, showToast: function (f) { var g = {}; c.extend(g, b, f); var j, e, d, i, h; j = (!c(".toast-container").length) ? c(" ").addClass("toast-container").addClass("toast-position-" + g.position).appendTo("body") : c(".toast-container"); e = c(" ").addClass("toast-item-wrapper"); d = c(" ").hide().addClass("toast-item toast-type-" + g.type).appendTo(j).html(c(" ").append(g.text)).animate(g.inEffect, g.inEffectDuration).wrap(e); i = c(" ").addClass("toast-item-close").prependTo(d).html(g.closeText).click(funct ion () { c().toastmessage("removeToast", d, g) }); h = c(" ").addClass("toast-item-image").addClass("toast-item-image-" + g.type).prependTo(d); if (navigator.userAgent.match(/MSIE 6/i)) { j.css({ top: document.documentElement.scrollTop }) } if (!g.sticky) { setTimeout(function () { c().toastmessage("removeToast", d, g) }, g.stayTime) } return d }, showNoticeToast: function (e) { var d = { text: e, type: "notice" }; return c().toastmessage("showToast", d) }, showSuccessToast: function (e) { var d = { text: e, type: "success" }; return c().toastmessage("showToast", d) }, showErrorToast: function (e) { var d = { text: e, type: "error" }; return c().toastmessage("showToast", d) }, showWarningToast: function (e) { var d = { text: e, type: "warning" }; return c().toastmessage("showToast", d) }, removeToast: function (e, d) { e.animate({ opacity: "0" }, 600, function () { e.parent().animate({ height: "0px" }, 300, function () { e.parent().remove() }) }); if (d && d.close !== null) { d.close() } } }; c.fn.toastmessage = function (d) { if (a[d]) { return a[d].apply(this, Array.prototype.slice.call(arguments, 1)) } else { if (typeof d === "object" || !d) { return a.init.apply(this, arguments) } else { c.error("Method " + d + " does not exist on jQuery.toastmessage") } } } }); التعديل باللون الأخضر أما الذي باللون الأحمر فيحدث لديه الخطأ ، حيث عند استدعاء الداله كأن الكود يخبرني بانه لم يجد الكائن الذي سيعرضه عند استخدامي لهذا الكود : رمز Code: sb.AppendLine("$().toastmessage('showToast', {"); sb.AppendLine(" text: '" + Message + "',"); sb.AppendLine(" sticky: true,"); sb.AppendLine(" position: 'top-right',"); sb.AppendLine(" type: 'success',"); sb.AppendLine(" closeText: '',"); sb.AppendLine(" } فهل هناك نقص في التعديلات التي اجريتها على المكتبه ؟؟! شاكر لكم حسن صبركم __DEFINE_LIKE_SHARE__ |
مواقع النشر (المفضلة) |
أدوات الموضوع | |
انواع عرض الموضوع | |
| |
المواضيع المتشابهه | ||||
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
منصة عربية لتحرير ومعاينة أكواد Html5,Css3,JQuery في الوقت الفعلي بمميزات قوية | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 07-17-2014 01:40 PM |
[ jquery ] تعلم JQUERY بالعربية و في 2 ساعات الان و حصريا على ترايدنت Traidnt | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 05-25-2014 03:10 PM |
[ jquery ] اظهار كلمة السر واخفائها بواسطه checkbox jquery | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 03-05-2014 02:30 PM |
مشكلة غريبة ..تعارض برنامج idm وتهنيجه للجهاز ؟؟؟ | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 09-22-2010 12:40 PM |
مشكلة بسبب تعارض هاك | محروم.كوم | منتدى أخبار المواقع والمنتديات العربية والأجنبية | 0 | 06-05-2009 08:10 PM |