Hi!
Have a slightly problem to deal with regarding the plugin Draggable and throwprops ON.
I have some images that I can throw and want the image im throwing should stick to the most accurate position of another image based on x and y positions.
Is there a way that I can run the snap function for getting the x, y properties as a singel function of the throwing object instead of calling x and y properties separated?
So I can match the throwing object to all the images x & y positions in one function instead of calling it twice.
Want to do something like this:
Draggable.create('.image',
{
bounds:'.container',
type:'x, y',
edgeResistance:0.65,
throwProps:true,
snap:function(x, y)
{
var pos = get_closest_image_pos(); // returns array [x:Number, y:Number]
return pos;
}
});
Instead of this:
Draggable.create('.image',
{
bounds:'.container',
type:'x, y',
edgeResistance:0.65,
throwProps:true,
snap:
{
x: function(endValue) {
return get_closest_image_pos_x(endValue);
},
y: function(endValue) {
return get_closest_image_pos_y(endValue);
}
});
Or is there another way?
Many thanks for the Greensock library! Pure GOLD!!