Monitor dom element attribute changes?

I have a <div> container whose size varies based on it's content. This content is loaded dynamically via ajax while the user is interacting with page and also based on screen size (for example, resize of the window will affect the content height). There's a sidebar which is using the affix plugin positioned at the left of my main container.

I want to check if the height of the sidebar is bigger than the content panel and based on that, set affix plugin or unset it!

I tried attrchange plugin but that's not exactly what I'm looking for because i never set an explicity attribute value to the element that I'm trying to monitor. The element height varies based on it's content which doesn't trigger any change event!!

Do I really need to be polling my element to check if there's any change on it's height?

Answers


Check this out. http://darcyclarke.me/development/detect-attribute-changes-with-jquery/

The implemention seems to use a settimeout to watch the attribute change


Need Your Help

Is it good practice to type-check argument in Racket

types scheme racket

I'm new in racket and I need as homework to write some program. Is it good practice to check the type of the arguments? For example, what is better:

MEF and generics and string

.net mef

I'm trying to use membershipreboot oss using MEF conventions but having trouble with generics and the string constant.