javascript - How do I pass a an element position to jquery UI dialog -


i have list of elements , when clicking on each 1 jqueryui dialog box pop next to list element clicked on.

$( "#selector" ).dialog({ draggable: false,               width: 250,               autoopen: false,               position: [e.pagex,e.pagey] });  $(".opendialog").click(function(e){         console.log('i need cooridnates x:'+e.pagex+' , y:'+e.pagey+'to passed dialog box');         $( "#selector" ).dialog("open"); }); 

i can coordinates need, i'm having trouble passing them dialog init.

would love insight this.

thanks in advance!

since want show dialog next clicked element, should defer setting dialog's position until information becomes available, i.e. in event handler:

$("#selector").dialog({     draggable: false,     width: 250,     autoopen: false });  $(".opendialog").click(function(e) {     $("#selector").dialog("option", "position", [e.pagex, e.pagey])                   .dialog("open"); }); 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -