javascript - jQuery why don't I get any output in the console -


i need have variable values change on window.resize() , add them global variable.

when try output variable section1 dont´t output in console , don´t understand why. nice if can help.

$(document).ready(function() {     var windowheight = $(window).height();     var section1, section2, section3;      $(window).resize(function(){             windowheight = $(window).height();             section1 = windowheight;             section2 = windowheight * 2;             section3 = windowheight * 3;             log();     });      function log() {       console.log(section1);     }   } 


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -