Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Mittwoch, 27. April 2011, 01:41

swfkrpano.js doesn't (completely) prevent page scrolling

Greetings

I have a problem on my webpage. "swfkrpano.js" mostly prevents the page from scrolling when using the mouse wheel, but sometimes, when I scroll the mouse wheel quickly, both the panorama zoom and the page scroll happen. I've tested it on Chrome and Firefox, and I'm using version 1.0.8.14 (I had the same problem with 1.0.8.12 though).

Can anyone reproduce the problem or has seen something similar before?

On this webpage it works perfectly for me: http://krpano.com/docu/html/swfobject15/mousewheelfix.html

Thanks,
Manuel
PanoTag: Facebook tagging for krpano

KRPano development and more: http://www.digisfera.pt/en/development

2

Mittwoch, 27. April 2011, 09:02

Hi,

do you have a link where it doesn't work?

best regards,
Klaus

3

Mittwoch, 27. April 2011, 10:30

Sorry, I forgot it. Here's an example:

http://www.digisfera.pt/ist-taguspark
PanoTag: Facebook tagging for krpano

KRPano development and more: http://www.digisfera.pt/en/development

4

Dienstag, 3. Mai 2011, 16:33

Hi,

in Firefox I can't reproduce the problem, but in Chrome yes - there the wheel sometimes scrolls the page,
but I think there is currently no solution possible for Chrome in this case - even when totally blocking the mouse wheel, it still scroll when using the mouse wheel very quickly...

best regards,
Klaus

5

Mittwoch, 4. Mai 2011, 02:32

Hi,

Zitat

in Firefox I can't reproduce the problem,
In my try tests I can reproduce it in Firefox (going very quickly with the mouse wheel)... In Internet Explorer it seems to not append.

SAlut.

6

Mittwoch, 4. Mai 2011, 02:40

Strange, here both firefox 3 and 4 have the same behaviour as Chrome. On IE it's working well though. I'm running Windows 7 64bit. I'll try it on linux tomorrow to see what happens.

Thanks
PanoTag: Facebook tagging for krpano

KRPano development and more: http://www.digisfera.pt/en/development

7

Donnerstag, 5. Mai 2011, 14:55

Hi,

sorry, but I'm really not able to reproduce it in Firefox or IE...
and from code side it shouldn't happens too, so I have no idea for that at the moment...

best regards,
Klaus

8

Samstag, 7. Mai 2011, 22:08

I'm experiencing the same problem (or actually my client is, I don't use a scrollmouse). I can reproduce it with almost any krpano instance on a scrolling page, though it is much easier to trigger in some then in others.

The problem seems to be that if a mousewheel event is fired at a moment when krpano is busy (or is keeping the browser, or the computer busy) by eg loading a tile or drawing a frame, the scrollwheel script fails to catch the event and prevent the default behavior. This would explain why on simple panoramas it is hard to trigger this bug, but it is easier on eg a gigapixel panorama with lots of hotspots coming in and out of view.

Unfortunately I cannot share the project I am working on right now, because it is a bit heavy on the client-side and reproduces the problem easily. But given some effort scrubbing the mousewheel up and down quickly, at least in Firefox I can reproduce it even on the simplest panoramas such as the old scrollwheel testbed:
http://krpano.com/docu/html/swfobject15/mousewheelfix.html
Using Chrome and IE, I cannot really get it to happen on simple panoramas like this. But larger project (gigapixel with hotspots etc), it's a real issue with all browsers I've tested.

9

Dienstag, 17. Mai 2011, 10:05

I've been able to fix it for my particular project. In my project the krpano page is shown as an "iframe" (actually as an object, because it is in an xhtml page), so the page that actually has the krpano content never needs to scroll. I use the following code to the iframed page:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<script type="text/javascript">
	window.onload = function() {
		var viewer = createPanoViewer({swf:"krpano.swf", id:"krpanoSWFObject", target:"krpanoDIV"});
		viewer.addVariable("xml", "krpano.xml");
		viewer.embed();

		allowBrowserScroll(false);
	}
	
	var browserScrolling;

	function allowBrowserScroll(value) {
		browserScrolling = value;
	}
	function wheel(event) {
		if (!event) {
			event = window.event;
		}
		if (!browserScrolling) {
			if (event.preventDefault) {
				event.preventDefault();
			}
			event.returnValue = false;
		}
	}
	if (window.addEventListener) {
		window.addEventListener('DOMMouseScroll', wheel, false);
	}
	window.onmousewheel = document.onmousewheel = wheel;
</script>


The code is loosely based on MouseWheelTrap:
http://www.spikything.com/blog/index.php…wser-scrolling/

Note that the code above will stop all mousewheel scrolling on the page that it is used on. One could use the allowBrowserScroll() function in onmouseover and onmouseout handlers for the krpano div, but I have not tested that.