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
Post a Comment