Steam Scroll

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        Steam Scroll
// @description Adds mouse wheel support to the horizontal screenshot slider on Steam product pages.
// @namespace   Steam
// @include     http://store.steampowered.com/app/*
// @version     1
// @grant       none
// ==/UserScript==

window.setTimeout(function() {
	function hscroll(event) {
		event.preventDefault();
		
		var down = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail))) <= 0;
		var item = jQuery('.highlight_strip_screenshot.focus')[down ? 'next' : 'prev']('.highlight_strip_screenshot')[0];
		if (!item) {
			var items = jQuery('.highlight_strip_screenshot');
			item = items[down ? 0 : items.length-1];
		}
		g_player.HighlightItem(item);
		g_player.ClearInterval();
	}

	var scroller = jQuery('#highlight_strip')[0];
	if (scroller.addEventListener) {
		scroller.addEventListener('mousewheel', hscroll, false);
		scroller.addEventListener('DOMMouseScroll', hscroll, false);
	}
	scroller.attachEvent('onmousewheel', hscroll);
	
	g_player.ClearInterval();
},100);