This is a demo of move.js
This image description will be moved above the image when the browser is resized under 600px! Try resizing your browser.
This image description will be moved above the image when the browser is resized under 600px! Try resizing your browser.
$('#content .desc').move({ breakpoint: 1000, oldLocation: '#content .container', newLocation: '#content h2', onMove: function(method, element) { if (method == 'oldLocation') { console.log('Moved back!'); } if (method == 'newLocation') { console.log('Moved to new location!'); } }, methods: { o: 'appendTo', n: 'insertAfter' } });
Your width based breakpoint, eg. 1000
.
Default: null
The old location for the element to be moved back to. eg #content .container
.
Default: null
The new location for the element to be moved to. eg #content
.
Default: null
Callback function for when an element is moved. Returned parameters are the method to move, ie newLocation
or oldLocation
, and the element that was moved. eg. function(method, element) {}
.
Default: null
The methods jQuery will use for handling moving your element around the DOM.
methods: { o: 'insertAfter', n: 'insertBefore' }
Default for both o
and n
: appendTo, where o
is the method for moving the element back to it's oldLocation, and n
is the method for moving the element into it's newLocation.
Valid properties: appendTo, prependTo, insertAfter, and insertBefore.