I have a jQuery function which contains a variable value
that should be updated every time the browser window is resized. I know, the problem is that the function isn’t executed again on resize but I don’t want the whole function to be executed again but only the variable to be updated. Is that possible?
value = parseInt( ( $(".height").css("height") ) ) ;
$( window ).resize( function () {
value = parseInt( ( $(".height").css("height") ) ) ;
});
$(function(){
$.scrollIt( {
upKey: 38,
downKey: 40,
easing: "easeIn",
scrollTime: 600,
activeClass: "active",
onPageChange: null,
topOffset: value
} );
};