Событие contextMenu неправильно назначает верхний атрибут ⇐ Jquery
-
Anonymous
Событие contextMenu неправильно назначает верхний атрибут
I used other examples I've found to create two fiddles to invoke a custom context menu. In the first, it's barebones and it works as expected, namely: set a previously hidden div to visible and move it to the top and left position of the mouse click.
https://jsfiddle.net/wolfie7873/unp53bhs/
In the simple example, the rightmost 2 columns have the custom contextmenu and the div appears where one right-clicks.
Trying to incorporate this into my actual use-case, and things don't work quite the same. Specifically, the visibility property as well as the left property are dynamically changed as expected, but the top property stays as the default of 0. You can see this in the second fiddle:
https://jsfiddle.net/wolfie7873/ksm8cxrb/1/
In this one, the columns with the pale-yellow headers are the ones that should invoke the contextMenu. The div for the context menu appears, but always at the top of the page.
Why isn't the top attribute being properly reassigned?
Источник: https://stackoverflow.com/questions/781 ... -attribute
I used other examples I've found to create two fiddles to invoke a custom context menu. In the first, it's barebones and it works as expected, namely: set a previously hidden div to visible and move it to the top and left position of the mouse click.
https://jsfiddle.net/wolfie7873/unp53bhs/
In the simple example, the rightmost 2 columns have the custom contextmenu and the div appears where one right-clicks.
Trying to incorporate this into my actual use-case, and things don't work quite the same. Specifically, the visibility property as well as the left property are dynamically changed as expected, but the top property stays as the default of 0. You can see this in the second fiddle:
https://jsfiddle.net/wolfie7873/ksm8cxrb/1/
In this one, the columns with the pale-yellow headers are the ones that should invoke the contextMenu. The div for the context menu appears, but always at the top of the page.
Why isn't the top attribute being properly reassigned?
Источник: https://stackoverflow.com/questions/781 ... -attribute
Мобильная версия