window程序的dropdown下拉的方向怎么获取?

window程序的dropdown下拉的方向怎么获取?怎么得到当前dropdown下拉弹出的方向是向上还是向下?

http://www.runoob.com/bootstrap/bootstrap-dropdown-plugin.html