Steam Scroll

Adds mouse wheel support to the horizontal screenshot slider on Steam product pages.

  1. // ==UserScript==
  2. // @name Steam Scroll
  3. // @description Adds mouse wheel support to the horizontal screenshot slider on Steam product pages.
  4. // @namespace Steam
  5. // @include http://store.steampowered.com/app/*
  6. // @version 1
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. window.setTimeout(function() {
  11. function hscroll(event) {
  12. event.preventDefault();
  13. var down = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail))) <= 0;
  14. var item = jQuery('.highlight_strip_screenshot.focus')[down ? 'next' : 'prev']('.highlight_strip_screenshot')[0];
  15. if (!item) {
  16. var items = jQuery('.highlight_strip_screenshot');
  17. item = items[down ? 0 : items.length-1];
  18. }
  19. g_player.HighlightItem(item);
  20. g_player.ClearInterval();
  21. }
  22.  
  23. var scroller = jQuery('#highlight_strip')[0];
  24. if (scroller.addEventListener) {
  25. scroller.addEventListener('mousewheel', hscroll, false);
  26. scroller.addEventListener('DOMMouseScroll', hscroll, false);
  27. }
  28. scroller.attachEvent('onmousewheel', hscroll);
  29. g_player.ClearInterval();
  30. },100);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址