scroll-thumb-minimum-size-notheme.html 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <!DOCTYPE html>
  2. <meta http-equiv="msthemecompatible" content="no">
  3. <div style="width: 200px; height: 200px; overflow: scroll;">
  4. <div style="width: 3725px; height: 3725px"></div>
  5. </div>
  6. <!--
  7. The size of the inner div is computed as follow:
  8. Input:
  9. outer_div_size: size of the div containing the scrollbar
  10. button_size: size of the scrollbar arrow buttons
  11. scrollbar_thickness: width/height of a vertical/horizontal scrollbar respectively
  12. thumb_size: height/width of the thumb of a vertical/horizontal scrollbar respectively
  13. Output:
  14. inner_div_size: size of the div to be scrolled
  15. Formula:
  16. slider_size = outer_div_size - 2 * button_size - scrollbar_thickness
  17. thumb_size = slider_size * (outer_div_size / inner_div_size)
  18. which gives:
  19. inner_div_size = (outer_div_size - 2 * button_size - scrollbar_thickness) * (outer_div_size / thumb_size)
  20. Testcase constants:
  21. outer_div_size = 200
  22. On XP/Vista at 96 dpi with theme disabled:
  23. thumb_size = 8 (minimum size)
  24. button_size = 17
  25. scrollbar_thickness = 17
  26. inner_div_size = (200 - 2 * 17 - 17) * (200 / 8) = 3725
  27. -->