Click the pop-up layer to hide other pop-up layers. (1. Hide all layers. 2. Determine whether the pop-up layer is displayed. If it is displayed, it is hidden. If it is hidden, it is displayed)
1. For ajax request data, use
$ ("# SimpleTip"). click (function (e ){
HideAllProp ();
If ($ ('# simple_cont'). is (": visible ")){
$ ("# Simple_cont"). hide ();
} Else {
$ ("# Simple_cont" ).css ({top: $ (this ). offset (). top + $ (this ). height (), left: $ (this ). offset (). left-18 }). show ();
$ ("# Simple_cont ul" ).html ("");
Var data = {};
Var dictionaryTable_Name = "complaint type ";
Var dictionaryClass_Name = "Complaint Service ";
Data = {dictionaryTable_Name: dictionaryTable_Name, dictionaryClass_Name: dictionaryClass_Name };
$. Ajax ({
Type: "POST ",
Url: getDictionaryAction,
DataType: "text ",
Data: data,
Success: function (data ){
Var jsonArr = data. split ("| ");
Var dataArr = eval ("(" + jsonArr [0] + ")");
Var elem;
For (var I = 0, j = dataArr. length; I <j; I ++ ){
$ ('<Li complaintsType =' + dataArr [I]. dictionaryItem_ID + '>' + dataArr [I]. itemName + '</li> '). appendTo ("# simple_cont ul "). click (function (){
Var complaintsType = $ (this). attr ("complaintsType ");
HideAllProp ();
$. Ajax ({
Url: complaintRegist,
Type: "post ",
DataType: "text ",
Data: {complaintRegisterSource: 1, complaintsType: complaintsType },
Success: function (data ){
$ (". IframeDiv"). show ();
ShowModal ();
$ ("# Success_pro" ).css ({left: $ ("div. rightCon "). offset (). left + 200, top: $ ("div. rightCon "). offset (). top + 100 }). show ();
Type = "simple ";
},
Error: function (data ){
$ (". IframeDiv"). show ();
ShowModal ();
$ ("# Failure_acc" 2.16.css ({left: $ ("div. rightCon "). offset (). left + 200, top: $ ("div. rightCon "). offset (). top + 100 }). show ();
}
});
});
}
},
Error: function (){
// HideFunPanel1 (0); hideFunPanel2 (0 );
$. Alert ("failed to get data! ");
}
});
// $ ("# Simple_cont" ).css ({left: $ (this ). offset (). left-$ ("# simple_cont "). width () + $ (this ). width (), top: $ (this ). offset (). top + $ (this ). height ()}). show ();
}
E. stopPropagation (); www.2cto.com
});
The click event cannot be directly used $ ("ul li"). click (function) {}); because ul li does not exist during page loading but is obtained through ajax requests.
From the web Front-end wyy Column