Code:
Copy codeThe Code is as follows:
// Page code (simplified)
<Asp: TextBox ID = "tbOperation2" runat = "server" onclick = "buttonclick ($ (this ))"
CssClass = "ui-button-icons-only" Text = "button"> </asp: TextBox>
<Div id = "editdialog" title = "Basic dialog">
<Div>
<Label onclick = "clickEdit ();" class = "labelbutton">
Edit </label>
</Div>
<Div>
<Label onclick = "clickView ();" class = "labelbutton">
View </label>
</Div>
<Div>
<Label onclick = "clickBuild ();" class = "labelbutton">
Build </label>
</Div>
</Div>
<Script type = "text/javascript"> // when the page is initialized
Var staticsignal;
$ (Function (){
// A workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
$ (": Input. ui-button-icons-only"). button (); // change the textbox Style
});
</Script>
<Script type = "text/javascript">
Function buttonclick (e)
{
Var offset = e. offset (); // get the offset
Var x = offset. left;
Var y = offset. top;
$ ("# Editdialog"). dialog ({
AutoOpen: true,
Draggable: true,
Resizable: false,
Position: [x, y + 35], // you can specify coordinates.
Width: 150
});
$ (". Ui-dialog-titlebar"). hide ();
$ ('A. ui-dialog-titlebar-close'). hide ();
Staticsignal = e;
}
</Script>
Haha is actually very simple, but it contains a lot of things. For details, refer to the relevant materials ~