Zoom In and Zoom out not working properly

i am using custom zoom in and zoom out using Go js diagram. but not working properly.
when i do frequently zoom in and zoom out the diagram getting very small. do you have any simplest method.
this my sample code i am using.
please help me.

design code:

my zoom in and zoom out code:

function updateSlider(slideAmount) {
var slide = parseInt(slideAmount);
var zoom = parseInt($("#Zoom").val());
if (slide > zoom) {
var count = slide - zoom;
for (var e = 0; e < count; e++) {
else {
var count = zoom - slide;
for (var e = 0; e <= count; e++) {


I haven’t tried your code, but is there a reason that in one case your iteration is limited by e <= count?