jquery resizable - is there any chance to get whether div is getting resized bigger or smaller than current size -


with jquery 'resizable' want resize div. .outerdiv has 1 more .innerdiv.

what want achieve is: when user resizes outer div, want calculate height of inner div (i can not give 100% height inner div).

i able new height this:

resize: function( event, ui ) {             var currentheight =  $('.table-container').height();             $('.table-container').height(currentheight+1);              } 

but when resize div smaller size want have

resize: function( event, ui ) {             var currentheight =  $('.table-container').height();             $('.table-container').height(currentheight-1);              } 

i not sure, how can condition, if resized upwards, size should smaller (height should - 1), , if downwards, size should bigger (height should + 1)

can give clues, how go it..

i believe function below solve problem. note semaphore , question mark operator:

function handleresizesignum(context) {     var previousheight;     var green = true;     function refreshpreviousheight(h) {         previousheight = h;     }     context.resize(function() {         if (!green) return;         green = false;         refreshpreviousheight($(this).height($(this).height() + ($(this).height() >= previousheight) ? 1 : -1).height());         green = true;     }); } 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -