2012-08-22 9 views

回答

1

在這裏你去隊友,我已經分叉並更新你的小提琴這裏

http://jsfiddle.net/joevallender/j5Vy9/

的代碼改變是本

var screenBottom = $(window).scrollTop() + $(window).height(); 
var menuHeight = _contextMenu.height(); 
var menuBottom = menuHeight + options.positionY; 
if(menuBottom > screenBottom) { 
    _contextMenu.css({ 
     top: "-=" + menuHeight 
    }) 
} 

只是你設置_contextMenu.css(後襬)

編輯只是再次測試,這不是像素完美,但它確實工作,應該給喲你一個體面的線索,如果你想調整它:)

+0

謝謝!我們很近! – evsar3

+1

爲了完美對齊,只需用_contextMenu.outerHeight()替換'_contextMenu.height()'謝謝。 – evsar3

+1

+1好打電話! 'outerHeight()'當然是最好的東西 – joevallender