1

i am trying to position my jQuery dialogue modal relative to the to the link that reveals the module. What I ideally like is to open the module directly centered underneath the link.

Below is my code, how would I change this to get the desired effect?

$("#tooltest").bind("click", function (e) {
  $("#LightboxTool").dialog({ 
    show: 'fade',
    hide: 'fade',
    modal: false,
    width: 320,
    minHeight: 180  
  });
  return false;
});
user229044
  • 232,980
  • 40
  • 330
  • 338
sat
  • 1,009
  • 3
  • 19
  • 41
  • Adapted answer to blog post: http://www.jensbits.com/2011/06/19/position-jquery-ui-dialog-relative-to-link/ Thanks for the question. – jk. Jun 09 '11 at 17:01

1 Answers1

4

keithnorm has answered this greatly in a jQuery forum as follows:

$('#dialog').dialog({
    position: { 
        my: 'top',
        at: 'top',
        of: $('#some_div')
    }
});

An also this question looks a like a dup of this.

Community
  • 1
  • 1
elhoyos
  • 849
  • 9
  • 19