When editor is logged to edit mode then window object contains "epi" property.
So maybe using:
// turn of functionality
could help to solve your problem.
Sweet! That might solve it... Many thanks!
@if (EPiServer.Editor.PageEditing.PageIsInEditMode == false)
// run custom renderring
Now when the page will be renderred in view mode there will be no exra JS condition.
And also when you use window.epi then it's easy to guess that this is based on EPiServer. In the second solution this information is not available.
The script will only be run once the browser window is resized... so it's okay in this case. Thanks anyway!