Function within if statement also running outside of if statement

have been trying to get this to work for some hours now but can't find the solution so some advice would be much appreciated! I have a function within an \[code\]if ($window.width() < 1000)\[/code\] statement which also runs outside of this statement.. So when the window width is > 1000 px the function also fires.. My question is simple.. Why? I'm 'logging' the if/else statement with the background colour which works fine, the colour changes back and forth when resizing.. When the page is < 1000px the right side list should be visually represented as a dropdown with tab functionality (same functionality as the dropdown list on the lift), and when the page is > 1000 the right side should be visually represented as tabs.CodeFull screen demo (makes it easier to scroll)
 
Back
Top