mix of e.data and custom event?

mix of e.data and custom event?

Hello all,

I think I need some help with a little question.

In my code I use e.data for a window resize function that changes CSS of elements.
So I have:

$(document).ready(function() {
      sizing_I({data: {zoom:2.4}});
      $(window). on('resize', function() { …other functions here… })
.on('resize', {zoom:2.4}, sizing_I);
});

and the function:

function sizing_I(e)
{
      var wh = $(window).height();
      var f = e.data.zoom; var f2 = f*2; var f4 = f*4; var f10 = f*10; var f20 = f*20; var f150 = f*150; var f300 = f*300;
      $("#elements") .css({'width': (wh/f10) + 'px','height': (wh/f) + 'px', 'margin-left': -(wh/f20) + 'px', 'margin-top': -(wh/f2) + 'px'})
      .find('div')
      .css({'width': (wh/f150) + 'px','height': (wh/f4) + 'px', 'margin-left': -(wh/f300) + 'px'});
}

that uses one „factor“ to resize, reposition (centering) and zoom elements.

Works satisfying.
But now I would want that from some other place (while animations are running) this „factor“ could be changed (possibly beeing animated to, but this later)

How could I change from some function the e.data later?

I know that this has something to do with custom Event and in theory I know the way but I have difficulties in understanding and using e.data and trigger(…) at the same time.
Because I like that the e.data is known at the beginning but could be neverthelss changed LATER on, too.

Thank you for your ideas and explanations!

Garavani