Passing parameters to $(window).on('resize') when using .trigger('resize')
问题 S/O! I need a reliable way to detect if $(window).on('resize') has been fired by user interaction or by a jQuery .trigger call. I've tried the following, but I don't seem to get the parameters back in the function call: $(window).trigger('resize',[true]); function prepareOnResize(e, triggered){ console.dir(triggered); } $(window).on('resize',prepareOnResize); Triggered seems to return the width of the screen, so I tried the following, also to no avail: $(window).trigger('resize',[true]);