I need to set a variables value within a function, but use it outside of the function. Can this be done?
$(document).ready(function() {
$(window).scroll(function () {
var myVar = something;
});
console.log(myVar);
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…