2010-03-20 10 views

risposta

15

provare

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

+1

non funziona se gli si assegna una collezione jQuery: 'alsoResize: $ ('. Altro, .al altro, .emanymore')' che è spiacevole se si ha una vista tipo Backbone e non si vuole ridimensionare tutto sulla pagina (ad esempio, voglio usare 'this. $ ('. other, .another, .andmanymore')') Il codice dell'interfaccia utente jQuery sembra evitarlo del tutto –

+0

perché 'this' non è un jQuery elemento che puoi fare '$ ('. other, .alother, .andmanymore'). add (this)' al posto o viceversa o perhasp '$ (this) .find ('. altro, .altro, .emanymore') ' – Val

+0

@CalebHearon e anche per non dimenticare containement: http://api.jqueryui.com/resizable/#option-containment – Val

0

questo può essere fatto combinando il 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, 
}); 
0

Se si dispone di riferimento a un oggetto è possibile utilizzare in questo modo:

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

È possibile passare in un array di stringhe in questo modo:

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

Queste stringhe dovrebbero rappresentare selettori. Puoi anche ridimensionare per classe o ID.

Problemi correlati