本帖最后由 rayn 于 2010-4-15 16:12 编辑
ajax loading状态显示不正确,修改下面两处地方
/source/ajax.js
334行- function ajaxmenu(e, ctrlid, isbox, timeout, func) {
- var offset = 0;
- var duration = 3;
- if (isUndefined(timeout)) {
- timeout = 0;
- }
- if (isUndefined(isbox)) {
- isbox = 0;
- }
- if (timeout > 0) {
- duration = 0;
- }
- showloading();
- if (jsmenu.active[0] && jsmenu.active[0].ctrlkey == ctrlid) {
- hideMenu();
- doane(e);
- return;
- } else if (is_ie &&
- is_ie < 7 && document.readyState.toLowerCase() != "complete") {
- return;
- }
- if (isbox) {
- divclass = "popupmenu_centerbox";
- offset = -1;
- } else {
- divclass = "popupmenu_popup";
- }
- var div = $(ctrlid + "_menu");
- if (!div) {
- div = document.createElement("div");
- div.ctrlid = ctrlid;
- div.id = ctrlid + "_menu";
- div.style.display = "none";
- div.className = divclass;
- $("append_parent").appendChild(div);
- }
- var x = new Ajax;
- var href = !isUndefined($(ctrlid).href) ? $(ctrlid).href : $(ctrlid).attributes.href.value;
- x.div = div;
- x.etype = e.type;
- x.get(href, function (s) {evaled = false;if (s.indexOf("ajaxerror") != -1) {evaled = true;}if (s.indexOf("hideMenu()") == -1) {s = "<h1>\u6D88\u606F</h1><a href="javascript:hideMenu();" class="float_del" title="\u5173\u95ED">\u5173\u95ED</a><div class="popupmenu_inner">" + s + "<div>";}if (!evaled) {if (x.div) {x.div.innerHTML = s;}showMenu(ctrlid, x.etype == "click", offset, duration, timeout, 0, ctrlid, 1000, true);if (func) {setTimeout(func + ("('" + ctrlid + "')"), 10);}}evalscript(s);
- showloading("none");//将隐藏LOADING放在异步调用完成后
- });
- //showloading("none"); 这句移到上面了,删掉
- doane(e);
- }
复制代码 434行- function showloading(display, wating) {
- var display = display ? display : "block";
- var wating = wating ? wating : "Loading...";
- $("ajaxwaitid").innerHTML = wating;
- //添加下面这一句,避免在第一屏之外看不到 loading
- $("ajaxwaitid").style.top = (document .documentElement.scrollTop || document .body.scrollTop)+'px';
- $("ajaxwaitid").style.display = display;
- }
复制代码 |