Skip to content

Commit 96752dd

Browse files
author
Rômulo Göelzer Portolann Malkiewiez
committed
Position: Make sure of is treated as a CSS selector [SO-2921446]
1 parent 6e6f946 commit 96752dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ui/position.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ $.fn.position = function( options ) {
141141
options = $.extend( {}, options );
142142

143143
var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
144-
target = $( options.of ),
144+
target = typeof options.of === "string" ?
145+
$( document ).find( options.of ) :
146+
$( options.of ),
147+
145148
within = $.position.getWithinInfo( options.within ),
146149
scrollInfo = $.position.getScrollInfo( within ),
147150
collision = ( options.collision || "flip" ).split( " " ),

0 commit comments

Comments
 (0)