Utilizing CSS media queries, I am able to display different layouts of my website based on the width of the screen. This involves showing and hiding specific elements accordingly.
However, in addition to this, I also need to rearrange elements within the DOM depending on the screen width. This means that a particular element needs to be relocated within the DOM tree.
Due to the nature of the content, which includes forms and other unique components, duplicating the element in the DOM tree and toggling visibility is not a suitable solution. Instead, I require a method to physically move the element around, ideally using jQuery.
While I came across this resource: http://css-tricks.com/media-query-change-detection-in-javascript-through-css-animations/ I am wondering if there are alternative approaches to achieve this functionality?