I'm currently using this jqFloat.js
that makes elements float in space around the page.
Unfortunately, they float in relation to the size of the screen, and not of their parent container, which is what I wish to achieve.
Here's the HTML of my structure
The class .wrapper is set at height: 100%; width: 85%; via CSS, and .project-item is the class of my floating items.
This is the source of jqFloat.js https://github.com/kennyooi/jqfloat/blob/master/jqfloat.js
At the moment my items are floating correctly, and at random position every time the page loads, but sometimes they get out from the wrapper (and the screen too).
I've tried to assign the .projects-item
(which is the class that triggers the floating effect) to the parent div, but then the items disappear.
What I basically have to achieve, I think, is to define a space within which the code of the jqFloat should run, and if one of the items touches one of the edges of the wrapper the item would have to "bounce".
Maybe I might have to set a rule on the script I'm using to randomly position the items instead of the jqFloat? This is not to exclude, but I'm also not very sure about.
This is the website at the moment, in its very rough design. The items (the body parts) have to stay within the green lines, which is the .wrapper
.
Any help is very very appreciated