function_all

// JavaScript Document
//带三角bar,点击三角区域下面内容展开
//$(function(){
//$("div[tit=openorclose]").toggle(function(){
//$(this).parent().next().slideDown(500); //slideUp  fadeOut
//$(this).attr("class","list_title_arrow_up")
//},function(){
//$(this).parent().next().slideUp(500); //slideDown fadeIn
//$(this).attr("class","list_title_arrow_down")
//});  
//});
var ver = navigator.appVersion //浏览器版本
//带三角bar,点击整个bar区域下面内容展开
$(function () {
    $("div[tit=tit_bar]").toggle(function () {
        $(this).next().slideDown(500); //slideUp  fadeOut
        $(this).children("div[tit=openorclose]").attr("class", "list_title_arrow_up")
    }, function () {
        $(this).next().slideUp(500); //slideDown fadeIn
        $(this).children("div[tit=openorclose]").attr("class", "list_title_arrow_down")
    });
});
 

$(function () {
    $("div[tit=left_father]").toggle(function () {
        $(this).next().slideDown(500); //slideUp  fadeOut
    }, function () {
        $(this).next().slideUp(500); //slideDown fadeIn
    });
});
//login_btn 2012年4月9日新增
$(document).ready(function () {
    $("input.btn").fadeTo("fast", 1.0); // This sets the opacity of the thumbs to fade down to 60% when the page loads  
    $("input.btn").hover(function () {
        $(this).fadeTo("fast", 0.8); // This should set the opacity to 100% on hover   
    }, function () {
        $(this).fadeTo("fast", 1.0); // This should set the opacity back to 60% on mouseout   
    });
});

//ipad系统开始

//ipad版系统切换背景
$(function () {
    //#region 孙路 2012-09-12 窗口高度变化时bot移动到底部(注意:在PC页面上高度有滚动条时,有问题)
    //以下代码是为了让按钮集和底部托盘按钮 居中。
    $("#mid_box").animate({ left: ($(window).width() - 910) / 2 +
        (ver.indexOf("MSIE 8") >= 0 || (ver.indexOf("Chrome") >= 0 && ver.indexOf("Maxthon") == -1) || (ver.indexOf("Safari") >= 0 && ver.indexOf("Maxthon") == -1) ? 0 : 10) 
    }, 500)
    $("#bot_meun").offset({ top: $(window).height() + 67, left: ($(window).width() - $("#bot_meun").width()) / 2 }).animate({ top: $(window).height() - 67 }, 500)
    $(window).resize(function () {
        $("#bot_meun").offset({ top: $(window).height() + 67, left: ($(window).width() - $("#bot_meun").width()) / 2 })
            .animate({ left: ($(this).width() - $("#bot_meun").width()) / 2, top: $(this).height() - 67 }, 500)
        $("#mid_box").animate({ left: ($(this).width() - 910) / 2 }, 500).css("top", $(window).height() / (7))
        //判断浏览器宽度,并将mid_box向上移。  
    });
    $("#mid_box").css("top", $(window).height() / (7));
//    if (!$.browser.msie || $.browser.version != "6.0") {//在非IE6下导入iepngfix.htc
//        $("*").css("behavior", "url(js/iepngfix.htc)");
//    }
});

$(function () {
    $("#bot_bar").css("top", $(window).height() - 28);
    var bi = $.cookie("background");
    if (bi)
        $("#imgBck").attr("src", bi).width($(window).width() + 20).height($(window).height())
    else
        $("#imgBck").attr("src", "img/body_bg.jpg").width($(window).width() + 20).height($(window).height())
    $("#divBck").width($(window).width()).height($(window).height()).css("position", "absolute")
})
function z() {
    if ($.browser.msie)
        $("#imgBck").attr("src", "img/body_bg.jpg").width($(window).width()).height($(window).height())
    else
        $("#imgBck").fadeOut(200, function () { $("#imgBck").attr("src", "img/body_bg.jpg").width($(window).width()).height($(window).height()).fadeIn(1000) })
    $.cookie("background", "img/body_bg.jpg", { expires: 30 });
}
function l() {
    if ($.browser.msie)
        $("#imgBck").attr("src", "img/body_bg2.jpg").width($(window).width()).height($(window).height())
    else
        $("#imgBck").fadeOut(200, function () { $("#imgBck").attr("src", "img/body_bg2.jpg").width($(window).width()).height($(window).height()).fadeIn(1000) })
    $.cookie("background", "img/body_bg2.jpg", { expires: 30 });
}
function b() {
    if ($.browser.msie)
        $("#imgBck").attr("src", "img/body_bg3.jpg").width($(window).width()).height($(window).height())
    else
        $("#imgBck").fadeOut(200, function () { $("#imgBck").attr("src", "img/body_bg3.jpg").width($(window).width()).height($(window).height()).fadeIn(1000) })
    $.cookie("background", "img/body_bg3.jpg", { expires: 30 });
}
function y() {
    if ($.browser.msie)
        $("#imgBck").attr("src", "img/body_bg4.jpg").width($(window).width()).height($(window).height())
    else
        $("#imgBck").fadeOut(200, function () { $("#imgBck").attr("src", "img/body_bg4.jpg").width($(window).width()).height($(window).height()).fadeIn(1000) })
    $.cookie("background", "img/body_bg4.jpg", { expires: 30 });
}
function f() {
    if ($.browser.msie)
        $("#imgBck").attr("src", "img/body_bg5.jpg").width($(window).width()).height($(window).height())
    else
        $("#imgBck").fadeOut(200, function () { $("#imgBck").attr("src", "img/body_bg5.jpg").width($(window).width()).height($(window).height()).fadeIn(1000) })
    $.cookie("background", "img/body_bg5.jpg", { expires: 30 });
}
$(function () {
    document.oncontextmenu = function () { return false; }
    document.onselectstart = function () { return false; }
    $(window).resize(function () {
        $("#imgBck").width($(window).width()).height($(window).height())
    })
})
//一级菜单btn图标 透明度
$(document).ready(function () {
    $("#focus img,#bot_meun img").fadeTo("fast", 1.0);
    $("#focus img,#bot_meun img:not(#bot_img)").hover(function () {
        $(this).fadeTo("fast", 0.5);
    }, function () {
        $(this).fadeTo("fast", 1.0);
    });
});
//基于全局的表单样式控制
$(function () {
    $(".tab_from input[type='text'],.tab_from input[type='file']").addClass("inputtext");

    $(".tab_from input[type='text'],.tab_from input[type='file']").hover(function () {
        $(this).addClass("inputhover");
    }, function () {
        $(this).removeClass("inputhover");
    });

});

//菜单按钮点击 开始
var canClick = true;
$(function () {
    var timer;
    $(document).mouseup(function () { if (timer) clearTimeout(timer); })
    var _width = $(window).width();
 
    //长按图标显示删除按钮,点击空白处隐藏 2012-10-15~16 by孙路
    //begin
    var timeFlag = false; //长按标识
    var mouse = { "x": 0, "y": 0 };
    $("#focus img,#bot_meun img").mousedown(function (e) {
        timeFlag = true;
        mouse = { "x": e.pageX, "y": e.pageY };
        timer = setTimeout((function () {
            if (timeFlag && $(".tempLi").length == 0) {
                $(".icon_box").prepend("<img class='del' src='icon/icon_icodel.png' style='position:absolute;z-index:1;margin-left:85px;' />")
                canClick = false;
                $(".del").click(function (event) { event.stopPropagation(); $(this).parents(".icon_box").remove(); })
                $(document).delegate("html", "click", function (e) {
                    e = e || window.event; // 事件
                    var obj = e.target || e.srcElement;
                    try {
                        if (obj.tagName != "IMG" || $(obj).attr("id") == "imgBck") {
                            $(".del").remove();
                            canClick = true;
                        }
                    }
                    catch (e) { }
                });
            }
        }), 1000)
    })
 .mousemove(function (e) {//移动10px就不触发
     if ((e.pageX > mouse.x + 10 || e.pageX < mouse.x - 10) || (e.pageY > mouse.y + 10 || e.pageY < mouse.y - 10))
         timeFlag = false;
 })
 .mouseup(function () { timeFlag = false; });
    //end
 
    //层级菜单(目前只支持三层) 开始 2013-01-17 by 孙路
    $("#focus > ul > li > div > ul > div > div > img").click(function () {
        if (canClick) {
            var $this = $(this)
            if ($("#mid_menu2_box_" + $this.attr("id")).length == 0 && icon[$this.attr("id")] != null) {
                var next = [];
                var inner = [];
                inner[inner.length] = '<div class="mid_menu2_box" id="mid_menu2_box_' + $this.attr("id") + '">'
                inner[inner.length] = '<div class="back_desktop"><img src="img/back_desktop.png" class="goback" /></div>'
                inner[inner.length] = '<div id="container" style="margin-top:15px;" >'
                inner[inner.length] = '<div class="scroll-pane" >'
                for (var i = 0; i < icon[$this.attr("id")].length; i++) {
                    inner[inner.length] = '<div class="icon_box">'
                    inner[inner.length] = '<div class="icon_img"><img src="' + icon[$this.attr("id")][i].src + '" id="' + icon[$this.attr("id")][i].id + '"></div>'
                    inner[inner.length] = '<div class="icon_text">' + icon[$this.attr("id")][i].tit + '</div>'
                    inner[inner.length] = '</div>'
                    if (icon[$this.attr("id")][i].next && icon[$this.attr("id")][i].id != "") {
                        next[next.length] = icon[$this.attr("id")][i].id;
                    }
                }
                inner[inner.length] = '</div></div></div>';
                $("#menu2").append(inner.join(""))
                //自定义滚动条
                $(".scroll-pane").jScrollPane();
                //二级返回一级的事件
                $(".back_desktop").click(function () {
                    $("#mid_box").animate({ left: ($(window).width() - 910) / 2, opacity: 1 }, 400);
                    $(this).parent().animate({ left: 1400, opacity: 0 }, 400);
                })
                $(".mid_menu2_box").mousewheel(function (event, delta) {
                    if (delta > 0) {
                        $("#mid_box").animate({ left: ($(window).width() - 910) / 2, opacity: 1 }, 400);
                        $(this).animate({ left: 1400, opacity: 0 }, 400);
                    }
                });
                //二级图标透明效果
                $(".mid_menu2_box img").hover(function () {
                    $(this).fadeTo("fast", 0.5);
                }, function () {
                    $(this).fadeTo("fast", 1.0);
                });
                //二级图标点击事件
                for (var n = 0; n < next.length; n++) {
                    for (var m = 0; m < icon[$this.attr("id")].length; m++) {
                        if (icon[$this.attr("id")][m].id == next[n]) {
                            $("#" + next[n]).click(function () {
                                var $this = $(this);
                                if ($("#mid_menu3_box_" + $this.attr("id")).length == 0) {
                                    var inner = [];
                                    var id = $this.parent().parent().parent().parent().parent().parent().parent().attr("id").split('_')[3];
                                    inner[inner.length] = '<div class="mid_menu3_box" id="mid_menu3_box_' + $this.attr("id") + '">'
                                    inner[inner.length] = '<div class="back2_menu"><img src="img/back_desktop.png" /></div>'
                                    for (var i = 0; i < icon[id].length; i++) {
                                        if (icon[id][i].id == $this.attr("id")) {
                                            for (var j = 0; j < icon[id][i].next.length; j++) {
                                                inner[inner.length] = '<div class="icon_box">'
                                                inner[inner.length] = '<div class="icon_img"><img src="' + icon[id][i].next[j].src + '" id="' + icon[id][i].next[j].id + '"></div>'
                                                inner[inner.length] = '<div class="icon_text">' + icon[id][i].next[j].tit + '</div>'
                                                inner[inner.length] = '</div>';
                                            }
                                        }
                                    }
                                    inner[inner.length] = '</div>';
                                    $("#menu3").append(inner.join(""));
                                    $(".back2_menu").click(function () {
                                        var id = $(this).parent().attr("id").split('_')[3]
                                        $("#" + id).parent().parent().parent().parent().parent().parent().parent().animate({ left: ($(window).width() - 910) / 2, opacity: 1 }, 400);
                                        $(this).parent().animate({ left: 1400, opacity: 0 }, 400);
                                    });
                                    $(".mid_menu3_box").mousewheel(function (event, delta) {
                                        if (delta > 0) {
                                            var id = $(this).attr("id").split('_')[3]
                                            $("#" + id).parent().parent().parent().parent().parent().parent().parent().animate({ left: ($(window).width() - 910) / 2, opacity: 1 }, 400);
                                            $(this).animate({ left: 1400, opacity: 0 }, 400);
                                        }
                                    });
                                    $(".mid_menu3_box img").hover(function () {
                                        $(this).fadeTo("fast", 0.5);
                                    }, function () {
                                        $(this).fadeTo("fast", 1.0);
                                    });
                                }
                                if ($("#mid_menu3_box_" + $this.attr("id")).length != 0) {
                                    $(this).parent().parent().parent().parent().parent().parent().parent().animate({ left: -952, opacity: 0 }, 400);
                                    $("#mid_menu3_box_" + $this.attr("id")).animate({ left: ($(window).width() - 920) / 2 + 5, opacity: 1 }, 400);
                                }
                            })
                        }
                    }
                }
            }
            if ($("#mid_menu2_box_" + $this.attr("id")).length != 0) {
                $("#mid_box").animate({ left: -952, opacity: 0 }, 400);
                var menu2show = null;
                var menu3show = null;
                for (var i = 0; i < $(".mid_menu2_box").length; i++) {
                    if ($(".mid_menu2_box").eq(i).offset().left == ($(window).width() - 920) / 2 + 5) {
                        menu2show = $(".mid_menu2_box").eq(i);
                        break;
                    }
                }
                for (var i = 0; i < $(".mid_menu3_box").length; i++) {
                    if ($(".mid_menu3_box").eq(i).offset().left == ($(window).width() - 920) / 2 + 5) {
                        menu3show = $(".mid_menu3_box").eq(i);
                        break;
                    }
                }
                if (menu2show) {
                    menu2show.animate({ left: 1400, opacity: 1 }, 400)
                    $("#mid_menu2_box_" + $this.attr("id")).animate({ left: ($(window).width() - 920) / 2 + 5, opacity: 1 }, 400);
                }
                else {
                    if (menu3show) {
                        menu3show.animate({ left: 1400, opacity: 0 }, 400);
                    }
                    $("#mid_menu2_box_" + $this.attr("id")).animate({ left: ($(window).width() - 920) / 2 + 5, opacity: 1 }, 400);
                }
            }
        }
    });
    //层级菜单(目前只支持三层) 结束
    //    $(".back_desktop").click(function () {
    //        //桌面返回,并且居中
    //        $("#mid_box").animate({ left: ($(window).width() - 910) / 2, opacity: 1 }, 400);
    //        //同时二级消失 
    //        $(this).parent().animate({ left: 1400, opacity: 0 }, 400);
    //    })
    //    $(".mid_menu2_box").mousewheel(function (event, delta) {
    //        if (delta > 0) {
    //            $("#mid_box").animate({ left: ($(window).width() - 910) / 2, opacity: 1 }, 400);
    //            $(this).animate({ left: 1400, opacity: 0 }, 400);
    //        }
    //    })
    //特殊事件(非层级菜单)
    $("#sysz").click(function () {
        if (canClick) {
            list("sysz")
        }
    })
    //二级菜单某一图标点击//
    //    $(".mid_menu2_box > div > div > div > div > img").click(function () {
    //        if ($("#mid_menu3_box_" + $(this).attr("id")).length != 0) {
    //            $(this).parent().parent().parent().parent().parent().parent().parent().animate({ left: -952, opacity: 0 }, 400);
    //            $("#mid_menu3_box_" + $(this).attr("id")).animate({ left: ($(window).width() - 920) / 2 + 5, opacity: 1 }, 400);
    //        }
    //    })
    //    //三级 返回按钮
    //    $(".back2_menu").click(function () {
    //        var id = $(this).parent().attr("id").split('_')[3]
    //        $("#" + id).parent().parent().parent().parent().parent().parent().parent().animate({ left: ($(window).width() - 910) / 2, opacity: 1 }, 400);
    //        $(this).parent().animate({ left: 1400, opacity: 0 }, 400);
    //    });
    //    $(".mid_menu3_box").mousewheel(function (event, delta) {
    //        if (delta > 0) {
    //            var id = $(this).attr("id").split('_')[3]
    //            $("#" + id).parent().parent().parent().parent().parent().parent().parent().animate({ left: ($(window).width() - 910) / 2, opacity: 1 }, 400);
    //            $(this).animate({ left: 1400, opacity: 0 }, 400);
    //        }
    //    })
 
})
//菜单按钮点击 结束 
 
//msg 弹出框 开始
$(function () {
    $("#msg").slideDown(1000);
    $(".msg_close_btn").click(function () {
        $("#msg").slideUp(1000);
    });
});
//首页头部右侧设置
$(function () {
    $("#system_set").toggle(function () {
        if ($(this).next().css("display") == "none") {
            $(this).next().slideDown(500);
            $("#system_set_down_content_bg").slideDown(500);
        }
        else {
            $(this).next().slideUp(500);
            $("#system_set_down_content_bg").slideUp(500);
        }
    }
  , function () {
      if ($(this).next().css("display") == "none") {
          $(this).next().slideDown(500);
          $("#system_set_down_content_bg").slideDown(500);
      }
      else {
          $(this).next().slideUp(500);
          $("#system_set_down_content_bg").slideUp(500);
      }
  });
    $(document).delegate("html", "mouseup", function (e) {
        e = e || window.event; // 事件
        var obj = e.target || e.srcElement;
        try {
            if ($(obj).attr("id") != "system_set_down_content") {
                $("#system_set").next().slideUp(500);
                $("#system_set_down_content_bg").slideUp(500);
            }
        }
        catch (e) { }
    });
});
//首页头部右侧任务栏
$(function () {
    var content = $("#task_bar_down_content");
    $("#task_bar").toggle(function () {
        if (content.css("display") == "none") content.slideDown(500);
        else content.slideUp(500);
    },
    function () {
        if (content.css("display") == "none") content.slideDown(500);
        else content.slideUp(500);
    })
    content.mouseleave(function () { $(this).slideUp(500); })
    $("#task_bar_down_content li").hover(function () { $(this).find("img").show() }, function () { $(this).find("img").hide(); })
})
//首页头部初始化和点击收起
$(function () {
    $("#top_userbox_outside").animate({ top: 0, opacity: 1 }, 1000);
    $("#user_text_left").offset({ left: (-($("#user_text_left").width() - 120)) + $("#user_center").offset().left - 7 })
});

//首页头部 三角收起与展开控制
$(function () {
    //初始化控制三角隐藏 
    $("#top_slide").hide();
    //鼠标放到 头部上面,控制三角出来
    $("#top_userbox_outside").hover(
 function () {
     $("#top_slide").stop().fadeIn(300);
 });
    $("#top_userbox_outside").mouseleave(function () {
        var top_position = $("#top_userbox_outside").offset().top
        if (top_position == 0) {
            $("#top_slide").stop().fadeOut(300);
        }
    });
    //点击控制三角,整个头部收起与展开 
    $("#top_slide").toggle(function () {
        $("#top_userbox_outside").stop().animate({ top: -56, opacity: 1 }, 500);
        $(this).children().attr("src", "img/top_slidedown.png")
    }
  , function () {
      $("#top_userbox_outside").stop().animate({ top: 0, opacity: 1 }, 1000, function () { $("#top_slide").stop().fadeOut(300); });
      $(this).children().attr("src", "img/top_slideUp.png");
  });
});
function mkgl() {
    art.dialog.open('menu_level_set.html', { title: '桌面图标管理', width: 520, height: 552, opacity: 0.2 });
}
function list(id) {
    //art.dialog.open('list.html', { title: '列表模型', width: 800, height: 426, opacity: 0.8 });
    $.dialog({ title: id, content: 'url:list.html', max: false, width: 800, height: 426,
        mined: function () {
            var self = this;
            var obj = this.DOM.wrap;
            var config = this.config;
            obj.addClass("min_window").hide();
            //.offset({ left: 0, top: ($(".min_window").length - 1) * obj.height() });
            $("#task_bar_down_content").slideDown(500)
            $("body").append("<div class='to_min' style='border:1px solid #000;position:absolute;'></div>");
            $(".to_min").width(config.width).height(config.height)
                .offset({ left: typeof config.left == "string" ? ($(window).width() - config.width) * Number(config.left.replace("%", "")) / 100 : config.left
                    , top: typeof config.top == "string" ? ($(window).height() - config.height) * Number(config.top.replace("%", "")) / 100 : config.top
                })

            $("#task_bar_down_content > ul").append("<li title='" + config.title + "'><a href='#'>"
                + (config.title.length > 4 ? config.title.substr(0, 3) + "..." : config.title)
                + "</a><div><img src='img/task_bar_close.gif' class='closeimg'></div></li>")
                .find("li").hover(function () { $(this).find("img").show() }, function () { $(this).find("img").hide(); })
                .click(function () {
                    if ($(this).index() != -1) {
                        obj.show();
                        $(this).remove();
                        self.DOM.main.show();
                        self.DOM.buttons[0].style.display = self._minRz.btn;
                        self.DOM.dialog[0].style.width = '';
                        self.config.resize = self._minRz;
                        self.DOM.rb[0].style.cursor.cursor = self._minRz.rzs ? 'se-resize' : 'auto';
                        delete self._minRz;
                        self._minState = false;
                    }
                })
                .find("img").click(function () {
                    $(this).parent().remove();
                    self.close();
                })
            var li = $("#task_bar_down_content > ul > li:last")
            $(".to_min").animate({ width: li.width() - 2, height: li.height() - 2, top: li.offset().top, left: li.offset().left },
                    function () {
                        $(".to_min").remove();
                    })
        },
        unmined: function () {
            //            var obj = this.DOM.wrap;
            //            obj.removeClass().offset({ top: ($(window).height() - obj.height()) / 2 });
            //            var min = $(".min_window")
            //            for (var i = 0; i < min.length; i++) {
            //                min.eq(i).animate({ top: i * min.height() })
            //            }
        }
    });
}
function form_template() {
    art.dialog.open('jquery-easyui-1.3.1/demo/form_template.html', { title: '表单模版样式', width: 400, height: 326, opacity: 0.8 });
}
$(function () {
    $(window).mouseup(function (e) {
        e = e || window.event;
        if (e.which == 3) {
            //history.go(0);
            $(".contextmenu").offset({ left: e.pageX, top: e.pageY }).hide().show(100)
        }
        else
            $(".contextmenu").offset({ left: 0, top: 0 }).hide();
    })
    $(".contextmenu").click(function () { history.go(0); })
})

转载于:https://my.oschina.net/u/583531/blog/308955

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值