-1

How do I adjust the position of the alert box on click in a scrollable div with ng-repeat? As my div height is small and if I give position: absolute alert box is getting hidden for the first row. z-index is not working. And if I give it position: fixed then that box is moving down as I scroll. I want to keep that box displayed on the clicked-on button like a tooltip.

Daniel
  • 3,541
  • 3
  • 33
  • 46
  • 4
    Can you add code, or context.. Something to work on it – Arthur Jul 13 '17 at 18:34
  • 1
    When asking a question about a problem caused by your code, you will get much better answers if you provide code people can use to reproduce the problem. See [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – georgeawg Jul 13 '17 at 21:58
  • Modal dialogs can **double error rates,** increase time to task completion, and are near-universally despised by users. Alternate means of notification are often available and should be utilized wherever possible and appropriate. See [What research is there suggesting modal dialogs are disruptive?](https://ux.stackexchange.com/questions/12637/what-research-is-there-suggesting-modal-dialogs-are-disruptive). – georgeawg Jul 13 '17 at 22:06

1 Answers1

0

Without seeing any code, it seems that you would like the position of the clicked element. Seeing as how you are using jquery, you could do that with something like this

$('#button-clicked').click(function(){
    var x = $(this).position().left;
    var y = $(this).position().top;
    //position alert box using positions from clicked button
})

check out jQuery: Difference between position() and offset() for more information

CumminUp07
  • 1,936
  • 1
  • 8
  • 21