Ergebnis 1 bis 12 von 12
-
11-09-2011, 15:23 #1
Foren As
- registriert
- 01-04-2011
- Beiträge
- 75
[JS] Greasemonkey Scroll Script
Hi,
in Windows kann man ja, wenn man die mittlere Maustaste (das Mausrad) gedrückt hält, scrollen. Da das in Linux nicht geht, habe ich mir einfach mal folgendes Script als Ersatz gebastelt:
Code:// ==UserScript== // @name Linux Scroller // @namespace // @description Helps to scroll on big pages in linux. // @include * // ==/UserScript== window.addEventListener("mousedown", down, false); window.addEventListener("mousemove", move, false); window.addEventListener("mouseup", up, false); window.down = false; function down(evt) { if (evt.button == 1) { window.down = true; window.scrollTo(((evt.pageX-window.pageXOffset)/window.innerWidth)*(document.body.offsetWidth-window.innerWidth), ((evt.pageY-window.pageYOffset)/window.innerHeight)*(document.body.offsetHeight-window.innerHeight)); } } function move(evt) { if (window.down == true) { window.scrollTo(((evt.pageX-window.pageXOffset)/window.innerWidth)*(document.body.offsetWidth-window.innerWidth), ((evt.pageY-window.pageYOffset)/window.innerHeight)*(document.body.offsetHeight-window.innerHeight)); } } function up(evt) { window.down = false; }
Installation: Greasemonkey auf den Browser packen (Firefox: Hier klicken, bei anderen Browsern hab ich keine Ahnung) und dann das Script installieren (Hier klicken).
Wie es sich verhalten sollte: Mittlere Maustaste gedrückt halten soll den gleichen Effekt haben wie Scrollbalken ziehen.
-
11-09-2011, 16:54 #2
AW: [JS] Greasemonkey Scroll Script
1. Get people to play Space Taxi
2. Sell real estates on neptun
3. Profit!
IE is not a browser, it is a scream.
Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read.
-
11-09-2011, 17:05 #3
AW: [JS] Greasemonkey Scroll Script
-
11-09-2011, 17:21 #4
AW: [JS] Greasemonkey Scroll Script
1. Get people to play Space Taxi
2. Sell real estates on neptun
3. Profit!
IE is not a browser, it is a scream.
Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read.
-
11-09-2011, 17:33 #5
Foren As
- registriert
- 01-04-2011
- Beiträge
- 75
AW: [JS] Greasemonkey Scroll Script
ich hab linux grad erst installiert, da kannste mir jetzt net erzählen, dass das kaputt ist.
abgesehen davon interessiert mich eher, ob das in windows geht!
-
11-09-2011, 17:38 #6
AW: [JS] Greasemonkey Scroll Script
Wenn es bei Dir nicht geht, dann fehlt ja wohl irgendetwas.
Du hast doch schon festgestellt, dass es unter Windows sowieso funktioniert, wie soll man denn unterscheiden, ob es läuft, weil es der Treiber mitliefert, oder weil es Dein Script ermöglicht?
Ansonsten löst Dein Script ein Problem, dass es nicht gibt, wenn man sein Linux richtig konfiguriert hat.1. Get people to play Space Taxi
2. Sell real estates on neptun
3. Profit!
IE is not a browser, it is a scream.
Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read.
-
11-09-2011, 18:37 #7
AW: [JS] Greasemonkey Scroll Script
Im firefox unter about:coonfig die Variable general.autoscroll auf true setzen, dann geht autoscroll.
-
11-09-2011, 18:43 #8
AW: [JS] Greasemonkey Scroll Script
1. Get people to play Space Taxi
2. Sell real estates on neptun
3. Profit!
IE is not a browser, it is a scream.
Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read.
-
12-09-2011, 13:44 #9
Foren As
- registriert
- 01-04-2011
- Beiträge
- 75
AW: [JS] Greasemonkey Scroll Script
@Albu: Mein Script macht NICHT das gleiche, wie die autoscroll-funktion, in der Autoscroll-Funktion wird in die Richtung der Mausbewegung gescrollt und in meinem Script wird der Scrollbalken zur Maus bewegt!
-
12-09-2011, 20:23 #10
AW: [JS] Greasemonkey Scroll Script
Ich habe Dein Script nicht installiert und mein Browser verhält sich so, wie Du das beschreibst. Und das nicht nur im Firefox.
Ich habe hier zwar nur Ubuntu 10.10 installiert, aber ich bin mir sicher, dass das auch in 11.04 und 11.10 genauso funktioniert. Wozu ich also Dein Skript benötigen sollte, weiß ich immer noch nicht.1. Get people to play Space Taxi
2. Sell real estates on neptun
3. Profit!
IE is not a browser, it is a scream.
Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read.
-
14-09-2011, 15:13 #11
Foren As
- registriert
- 01-04-2011
- Beiträge
- 75
AW: [JS] Greasemonkey Scroll Script
In meinem Script springt der Scrollbalken zur Maus, wenn ich die Taste drücke.
In der autoscroll-funktion bewegt sich der Balken nach oben/unten, wenn die Maus über/unter der Position ist, an der die Maustaste runtergedrückt wurde.
Und das ist definitiv nicht das gleiche.
-
14-09-2011, 15:26 #12
AW: [JS] Greasemonkey Scroll Script
Genau wie bei mir - ohne Dein Script.
Es mag sein, dass die "autoscroll"-Funktion nicht das macht, was Dein Script macht, aber bei mir verhalten sich die Browser so wie Du beschreibst, ohne dass ich irgendein Script brauche. Zumal Chrome diese Autoscroll-Funktion vermutlich gar nicht besitzt.
Entweder verstehe ich also Deine Funktionsbeschreibung komplett falsch oder Dein Linux ist kaputt. In beiden Fällen sehe ich aber keine Verwendung für Dein Script.1. Get people to play Space Taxi
2. Sell real estates on neptun
3. Profit!
IE is not a browser, it is a scream.
Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read.
Ähnliche Themen
-
Greasemonkey Script schreiben
Von RobbyBubble im Forum JavaScriptAntworten: 32Letzter Beitrag: 08-03-2011, 17:24 -
Script / greasemonkey /weiterleitung
Von Ardonos im Forum JavaScriptAntworten: 6Letzter Beitrag: 01-03-2011, 15:57 -
Greasemonkey Script entwickeln
Von web2go im Forum JavaScriptAntworten: 26Letzter Beitrag: 11-03-2009, 14:19 -
Greasemonkey Script umschreiben?
Von BlackMatrix im Forum JavaScriptAntworten: 1Letzter Beitrag: 23-09-2008, 11:38 -
Greasemonkey script, um google zu erweitern
Von jahlives! im Forum JavaScriptAntworten: 3Letzter Beitrag: 18-04-2008, 13:43
Lesezeichen