Reputation: 14251
I have a div that I want to scale. I am using the jQuery-UI resizable option for this, but it isnt resizing the children, why?
This is the code I use to instantiate it:
$(this).resizable({
alsoResize: $(this).find('*'),
});
The code is deep inside an app so I created a fiddle that should contain the important parts: http://jsfiddle.net/EnK4R/6/
This works with the image tag: http://jsfiddle.net/EnK4R/12/ I just cant figure out why the '*' selector wont work
Upvotes: 0
Views: 3975
Reputation: 6544
here you go. this doesnt seem to resize whole document, checkout the fiddle at bottom
var init = function(){
$(this).resizable({
alsoResize: '#'+$(this).attr('id')+' *'
});
}
init.call($('#window'));
this keeps the code almost as short as yours, and it will work with what ever gets chucked into the init call. enjoy :)
Upvotes: 2
Reputation: 22448
first of all fix the window class selector: change it from .window
to #window
. And use selector string for alsoResize
option:
$('#window').resizable({
alsoResize: '#window *'
});
fiddle: http://jsfiddle.net/1stein/EnK4R/
Upvotes: 0