The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Rearranging DOM elements with jQuery
Hey,
I am having a bit of trouble making jQuery rearrange two divs when the browser width is mobile.
At the moment I am using this code:
But in my console I am getting “Uncaught ReferenceError: mobile is not defined”
Any ideas?
http://oandg.co.uk.s156312.gridserver.com/
Is ‘mobile’ a JQ hook?
I can’t find it referenced in the documentation?
If it is….and I confess to being a JS/JQ noob….don’t you have to wrap the js you are using in a self invoking function?
[script] if (mobile == true) { $(‘#bottom’).insertBefore($(‘#top’)); } [/script]
Not as far as I know.
See caveats above though.