Rotation of object (using its images) on button click using javascript/jquery -
i using jquery plugin showing rotation of object using objects images(images captured every angle).rotation working fine on mouse click.the thing want make rotation possible of buttons(i.e.,left ,right,top,down buttons) .on clicking left button images must show rotation clockwise or left direction , vice-versa.can me please
i have try following code :
$(function(){ $('#image').reel({ frames: 20, frame: 14, footage: 10, rows: 13, row: 8, cw: true, inversed: false, speed: 0, images: 'drilbit/drilbit_normal_###.png', cursor: 'move', preloader: 3, draggable: true, wheelable: true, throwable: true, //steppable:true, }); });
in reel plugin documentation described in this (annotated source code) process.
triggering stepright
, stepleft events
on reel object performs adequate actions. should bind event calls control buttons.
$(function(){ var reelobject = $('#image').reel({ //required options steppable:true }); $('#button-right').click(function (){ reelobject.trigger('stepright'); }) $('#button-left').click(function (){ reelobject.trigger('stepleft'); }) });
the same idea can used up/down events.
here jsfiddle demonstration.
//edit: added jsfidle demonstration.
Comments
Post a Comment