meetselva / attrchange

onattrchange listener
GNU General Public License v3.0
207 stars 57 forks source link

listening to changes of div with resize css #21

Closed nachikethashu closed 8 years ago

nachikethashu commented 8 years ago

Hi, May I know what's wrong in the following code snippet? http://jsfiddle.net/nachikethashu/tr307kcr/3/

Basically I have a div with following css:
resize: both;
overflow: auto;

And I'm trying to listen to height changes with following snippet $('#test').attrchange({ callback: function (e) { $('#logger').text('height changed to ' + $(this).height()); } });

meetselva commented 8 years ago

Looks like it is a bug in Chrome: https://code.google.com/p/chromium/issues/detail?id=293948

The jsfiddle works fine in FF.

However, the plugin has an extension that uses polling to detect attribute change which should work fine in all browsers but note it uses polling to detect,

Polling example: http://jsfiddle.net/zdhsmuu2/

nachikethashu commented 8 years ago

Oh someone asked the exact question 2 years before and still it's not fixed! This is an example of major browsers killing nice features like MutationObserver.. :(