r1595 - trunk/demos/slider

r1595 - trunk/demos/slider


Author: scottjehl
Date: Mon Jan 12 10:00:29 2009
New Revision: 1595
Modified:
trunk/demos/slider/side_scroll.html
Log:
added content panel reflowing if the handle is all the way right and the
window gets wider
Modified: trunk/demos/slider/side_scroll.html
==============================================================================
--- trunk/demos/slider/side_scroll.html    (original)
+++ trunk/demos/slider/side_scroll.html    Mon Jan 12 10:00:29 2009
@@ -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