I\'m looking to create something that can move randomly inside of a fixed div container. I love the way the object moves in this example that I found searching this website...>
Add a wrapper element around it and update the jQuery to limit the dimensions.
// Get viewport dimensions (remove the dimension of the div) var h = $('#wrap').height() - 50; var w = $('#wrap').width() - 50;
Here's an updated fiddle: http://jsfiddle.net/Xw29r/375/