Sólo trate de esta func (que puede trabajar no sólo para divs):
function resized(elem, func = function(){}, args = []){
elem = jQuery(elem);
func = func.bind(elem);
var h = -1, w = -1;
setInterval(function(){
if (elem.height() != h || elem.width() != w){
h = elem.height();
w = elem.width();
func.apply(null, args);
}
}, 100);
}
Se puede utilizar de esta manera
resized(/*element*/ '.advs-columns-main > div > div', /*callback*/ function(a){
console.log(a);
console.log(this); //for accessing the jQuery element you passed
}, /*callback arguments in array*/ ['I\'m the first arg named "a"!']);
ACTUALIZACIÓN: También puede utilizar observador más progresivo (que puede funcionar para cualquier objeto, no sólo los elementos DOM):
function changed(elem, propsToBeChanged, func = function(){}, args = [], interval = 100){
func = func.bind(elem);
var currentVal = {call: {}, std: {}};
$.each(propsToBeChanged, (property, needCall)=>{
needCall = needCall ? 'call' : 'std';
currentVal[needCall][property] = new Boolean(); // is a minimal and unique value, its equivalent comparsion with each other will always return false
});
setInterval(function(){
$.each(propsToBeChanged, (property, needCall)=>{
try{
var currVal = needCall ? elem[property]() : elem[property];
} catch (e){ // elem[property] is not a function anymore
var currVal = elem[property];
needCall = false;
propsToBeChanged[property] = false;
}
needCall = needCall ? 'call' : 'std';
if (currVal !== currentVal[needCall][property]){
currentVal[needCall][property] = currVal;
func.apply(null, args);
}
});
}, interval);
}
Haga la prueba :
var b = '2',
a = {foo: 'bar', ext:()=>{return b}};
changed(a, {
// prop name || do eval like a function?
foo: false,
ext: true
},()=>{console.log('changed')})
se registrará 'cambiado' cada vez que se cambia b, a.foo o a.ext directamente
los eventos de cambio de tamaño solo se activan en objetos de ventana (y ¿iframes quizás?). – BiAiB
echa un vistazo a esta página - http://benalman.com/code/projects/jquery-resize/examples/resize/ – Elen