javascript - Raphael zoom goes out of view - add scroll bar -
i have implemented zoom in raphael using setviewbox() technique. when keep zooming view box becomes bigger paper canvas size , elements on diagram no longer visible. there way add scroll bar around paper when elements go out of view, user can use scroll bar see section of diagram has gone out of view.
thanks, dikshit
look @ demo , tell me if want, or give me comments based on it.
var p = raphael("canvas"); var c = p.circle(150,150,80).attr({fill:'yellow'}); var cx = 300; var cy = 300; $('#zi').click(function() { cx *= 1.5; cy *= 1.5; p.setviewbox(0, 0, cx, cy, true); }); $('#zo').click(function() { cx /= 1.5; cy /= 1.5; p.setviewbox(0, 0, cx, cy, true); });
Comments
Post a Comment