Unfortunately, no. The {}
syntax initiates creation of a new object, but until the object is created, it is not assigned to the carousel
variable. Also, the this
value can only change as a result of a function call. If your "several more properties" are all going to depend only on slider
, then you could get around with something like this:
var slider = $('.slider');
var carousel = {
panes: slider.children.length(),
something: slider.something_else,
// ...
};
carousel.slider = slider;