Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Hide scroller when container is resized to be bigger than the content.

  • Loading branch information...
commit b41e4e0b751f64d5472a72726cb0fb7ca4091bf7 1 parent 8f24c1a
Reimund Trost authored August 13, 2012

Showing 1 changed file with 17 additions and 5 deletions. Show diff stats Hide diff stats

  1. 22  jquery.scroll.js
22  jquery.scroll.js
@@ -458,23 +458,35 @@ Changelog:
458 458
         // repaint scrollbar height and position
459 459
         //
460 460
         repaint: function(){
461  
-            this.setHandleContainerSize();
  461
+			this.setHandleContainerSize();
462 462
             this.setHandle();
463 463
             this.setHandlePosition();
464 464
         },
465 465
 
466  
-        //
467  
-        // update the height of the handleContainer
468  
-        //
  466
+		//
  467
+		// update the height of the handleContainer
  468
+		//
469 469
         setHandleContainerSize: function() {
470 470
             this.props.containerHeight = this.container.height();
471 471
 
  472
+			// hide the scroller if the content height is lower than the
  473
+			// container height
  474
+			if(this.props.contentHeight <= this.props.containerHeight) {
  475
+            	this.handleContainer.hide();
  476
+				this.handleArrowDown.hide();
  477
+				this.handleArrowUp.hide();
  478
+			} else {
  479
+            	this.handleContainer.show();
  480
+				this.handleArrowDown.show();
  481
+				this.handleArrowUp.show();
  482
+			}
  483
+
472 484
             this.handleContainer.css({
473 485
                 'position': 'absolute',
474 486
                 'top':      this.handleArrowUp.outerHeight(true),
475 487
                 'height':   (this.props.containerHeight - this.handleArrowUp.outerHeight(true) - this.handleArrowDown.outerHeight(true)) + 'px'
476 488
             });
477  
-        },
  489
+		},
478 490
 
479 491
 
480 492
         //

0 notes on commit b41e4e0

Please sign in to comment.
Something went wrong with that request. Please try again.