Need help randomizing div positioning
What I am trying to do is randomize the position of a div that slides in from the left when you hover over an image.
Here is the script I am working with courtesy of
Build Internet
- $('.boxgrid1.captionfull').hover(function(){
$(".cover", this).stop().animate({right:'30%'},{queue:false,duration:300});
}, function() {
$(".cover", this).stop().animate({right:'100%'},{queue:false,duration:300});
});
Here is the css that goes with it
- .captionfull .boxcaption {
top: 18%;
right: 200em;
}
I would like to randomize the value of the top position in the css and the value of right:'30%' with values in a preset range.
I searched around a bit and saw randomXtoY, would this work? or is there an easier way of doing it?
I am going to mess around some more, but any and all help is appreciated!