This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".dropdown-toggle").click(function(e) { | |
var menu = $(this).next('.dropdown-menu'), | |
mousex = e.pageX + 20, //Get X coodrinates | |
mousey = e.pageY + 20, //Get Y coordinates | |
menuWidth = menu.width(), //Find width of tooltip | |
menuHeight = menu.height(), //Find height of tooltip | |
menuVisX = $(window).width() - (mousex + menuWidth), //Distance of element from the right edge of viewport | |
menuVisY = $(window).height() - (mousey + menuHeight); //Distance of element from the bottom of viewport | |
if (menuVisX < 20) { //If tooltip exceeds the X coordinate of viewport |
NewerOlder