I want to update a tween variable as per window's width on window resize. I have tried with below code but it seems not working. Could you please help me?
var logoWidth = 100;
window.onresize = function(){
logoWidth = (window.innerWidth > 767) ? 100 : 50;
}
var _timeline = new TimelineMax();
_timeline.to(element, 1, {width:logoWidth});
Any help appreciated!