日期:2014-05-16 浏览次数:20360 次
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="AppMenu_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <script src="../Content/jquery-1.7.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $("#AppMenu div span").click(function() { // $(this).css("background", "red"); var m_div = $(this); if (m_div.closest("div").children("div").text() == "") { var mid = $(this).attr("id"); // alert(mid); $.post("AppMenuExt.ashx?p=" + mid, function(data, status) { if (status != "success") { alert("加载失败"); } else { //alert(data.toString()); // m_div.closest("div").children("div").css("background", "green"); if (data.toString() != null) { m_div.closest("div").children("div").append(data.toString()); // m_div.closest("div").children("div").append("<span>aaaa</span>"); //alert(m_div.children("img").attr("src")); m_div.children("img").attr("src", "./images/menu2.png"); new appMenu1("mid", mid); //alert(mid); } } }); } else { //alert("div not null"); if (m_div.closest("div").children("div").css("display") == "none") { m_div.children("img").attr("src", "./images/menu2.png"); m_div.closest("div").children("div").css("display", "block"); } else { m_div.children("img").attr("src", "./images/menu1.png"); m_div.closest("div").children("div").css("display", "none"); } } }); }); function appMenu1(key, value) { $(".folder").click(function() { // alert("key=" + key + "|value=" + value); //$(this).css("background", "blue"); var divspan = $(this); //alert(mid); if (divspan.closest("div").children().text() == "") { var mid = $(this).attr("id"); $.post("AppMenuExt.ashx?p=" + mid, function(data, status) { if (status != "success") { alert("加载失败"); } else { // alert(data.toString()); if (data.toString().length !