I have a responsive site where I use javascript to create a sticky sidebar.
I also use media queries to go from multi-column layout to single-column layout when the browser size is less than 768 pixels.
I need to figure out how to disable a sticky script menu in a single column layout. Essentially, I need something like a media query for a script statement.
This is the code I use to include the script:
<script> jQuery('#info').containedStickyScroll({ duration: 0, unstick: false }); </script>
Is there something I can add to it to call it only if the window has a width or width of 768 pixels?
EDIT: I'm looking for a solution that will work if the user resizes the window on the fly.
source share