Keerthi Keerthi - 1 month ago 7x
Javascript Question

Position a JQuery Dialog over another div

I am showing a JQuery dialog on a button click (add to cart button). The JQuery dialog shows the message 'x item(s) added to cart' and auto closes in y seconds. I want to display the dialog exactly on the add to cart button. The add to cart becomes visible only after the dialog box auto closes. How would I do it?


Change position to the following:

  autoOpen: false,
  modal: false,
  position: {
      my: 'left top',      //The point on the dialog box
      at: 'left top',      //The point on the target element
      of: $('#addtocart')  //The target element
  draggable: true,
  width: '40%'