开发者

jQuery resizable() and multiple alsoResizes?

Is there a way to set multiple alsoResizes in jQuery UI?

$('.selector').resizable({ alsoResize: '.ot开发者_运维技巧her' });

I would like to set a couple of other elements to also resize, not just one. The official documentation tells nothing.


try

$('.selector').resizable({ alsoResize: '.other,.another,.andmanymore' });


this can be done by combining the div s.

var foo = $('.foo').attr('id');
var bar = $('.bar').attr('id');
var bar = $('.bar').attr('id');
var alsos = '#' + foo + ', #' + bar; 


$('.selector').resizable({
alsoresize:alsos, 
});


If you have object reference then you can use like this:

$(el).resizable(
        {
            alsoResize: [ el.children[0], el.children[1] ]
        });


You can pass in an array of strings like so:

$('.selector').resizable({ alsoResize: [
    '.other',
    '.and-another',
    '#and-one-more'
]});

These strings should represent selectors. You can also resize by class or id.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜