I’m trying to create a scroller plugin with jQuery. I need to catch the container elements resizing events to set the scroll position for new size. But I’m stuck on this issue: .resize() doesn’t work on Chrome for any element but window.
Is there any way to catch resizing events with jQuery or JavaScript? I’ve also tried setting onresize attribute but it fires for once. I added the jsFiddle link below.
From MDN:
The jQuery docs also only mention
window.Perhaps you could benefit from the jQuery resize event plugin which seems to do exactly what you need.
EDIT: Here is an updated fiddle that includes the plugin. The code is identical, but it works as you expect because it includes the plugin (see the “Add Resources” tab in the fiddle).