Position: Allow without "at" option passed. (Not need it when align to cursor.)

This commit is contained in:
Chi Cheng 2009-07-30 13:21:21 +00:00
parent 20e13a4d77
commit 175f36076b

View File

@ -51,7 +51,7 @@ $.fn.position = function(options) {
// force my and at to have valid horizontal and veritcal positions // force my and at to have valid horizontal and veritcal positions
// if a value is missing or invalid, it will be converted to center // if a value is missing or invalid, it will be converted to center
$.each(['my', 'at'], function() { $.each(['my', 'at'], function() {
var pos = options[this].split(' '); var pos = ( options[this] || horizontalDefault ).split(' ');
pos = pos.length == 1 pos = pos.length == 1
? horizontalPositions.test(pos[0]) ? horizontalPositions.test(pos[0])
? pos.concat([verticalDefault]) ? pos.concat([verticalDefault])