What is an object equivalent to an array position in jQuery user interface?

There is a position option in jQuery UI Dialog widgets, which can be an object, a string or an array (with the String and Array forms obsolete). The array may contain a pair of x, y coordinates in the pixel offset from the upper left corner of the viewport. I do not understand what the equivalent of an object is. Examples of objects in the documentation use strings, such as left or center, rather than pixel coordinates.

How would you write

position: [42, 80] 

using Object notation?

+4
source share
1 answer

You can specify an offset for a position parameter using object notation.

 $('.selector').dialog({ position: { my: 'left+42 top+80', at: 'left+42 top+80' } }); 

http://jsfiddle.net/rknjG/

+2
source

Source: https://habr.com/ru/post/1502831/


All Articles