I would like to know if a better way is possible than this, as it spared the repetition of code:
I usually do:
if($(window).width() > 800) {
// BLAH BLAH BLAH
}
$(window).resize(function(){
if($(window).width() > 800) {
// BLAH BLAH BLAH
}
});
This does not seem to be a viable / good code implementation since I am repeating code (BLAH BLAH BLAH), is there any way to put the two conditions within it?