Permalink
Browse files

added content panel reflowing if the handle is all the way right and …

…the window gets wider
  • Loading branch information...
1 parent ff20a3e commit 204742d1dfcf6fbdb93fd8f549fc18de87cfb4b6 Scott Jehl committed Jan 12, 2009
Showing with 9 additions and 0 deletions.
  1. +9 −0 demos/slider/side_scroll.html
@@ -59,12 +59,21 @@
var percentage = Math.round(leftVal / remainder * 100);
scrollbar.slider("value", percentage);
}
+ //if the slider is 100% and window gets larger, reveal content
+ function reflowContent(){
+ var showing = scrollContent.width() + parseInt( scrollContent.css('margin-left') );
+ var gap = scrollPane.width() - showing;
+ if(gap > 0){
+ scrollContent.css('margin-left', parseInt( scrollContent.css('margin-left') ) + gap);
+ }
+ }
//change handle position on window resize
$(window)
.resize(function(){
resetValue();
sizeScrollbar();
+ reflowContent();
});
//init scrollbar size
setTimeout(sizeScrollbar,10);//safari wants a timeout

0 comments on commit 204742d

Please sign in to comment.