code: function bindButton($button, factor){
              var zoomInterval;
  
              $button.bind("mousedown", function(e){
                e.preventDefault();
                e.stopPropagation();
  
                if( e.button != 0 ){
                  return;
                }
  
                var doZoom = function(){
                  var zoom = cyRef.zoom();
                  var lvl = cyRef.zoom() * factor;
  
                  if( lvl < options.minZoom ){
                    lvl = options.minZoom;
                  }
  
                  if( lvl > options.maxZoom ){
                    lvl = options.maxZoom;
                  }
  
                  if( (lvl == options.maxZoom && zoom == options.maxZoom) ||
                    (lvl == options.minZoom && zoom == options.minZoom)
                  ){
                    return;
                  }
  
                  zoomTo(lvl);
                };
  
                startZooming();
                doZoom();
                zoomInterval = setInterval(doZoom, options.zoomDelay);
  
                return false;
              });
  
              windowBind("mouseup blur", function(){
                clearInterval(zoomInterval);
                endZooming();
              });
            }
docs: set up zoom in/out buttons ///////////////////////////