Javascript helper to enable media-query approach on screen resolution detached DOM elements