View Full Version : "Next" and "Previous" OnClick function?
Panorado
02-27-2008, 07:05 AM
I can load a pano fine by it's name... but just want simple, OnClick "next" and "previous"... I didn't see this ability in the tutorial... is it possible?
zleifr
02-27-2008, 01:54 PM
yeah, you just have to program in a list of functions that have you loadPano commands, and then have the next button refer to the right one and the previous button refer to the right one. And the on clicking either, you have to execute the function, AND switch the function that will be called on clicking either button.
Zephyr
cheathamlane
02-27-2008, 02:50 PM
I can load a pano fine by it's name... but just want simple, OnClick "next" and "previous"... I didn't see this ability in the tutorial... is it possible?
If you're using hotspots, then like Zephyr says you'll need to manually do it. You could put a couple functions in your <global/> element ("nextPano", "previousPano"), which all they do is load a next or previous panorama.
Then, have a series of "next" and "previous" button <spots>, each set linked to a particular pano. The onclick function for each could call your <global/> function(s), plus change the <global/> function(s) to reflect the new next/previous panoramas.
<global nextPano="loadPano(panoName=nature)" />
.
.
.
<spot linked="myPano" onClick="global.nextPano;global.nextPano=loadPano(panoName= otherPano)"
Hmmm... I haven't tested it, but theoretically it should work. :)
This is why I built that functionality into the dropdown menu plugin -- you can have a spot with a special attribute of "next" of "previous", and the menu will handle loading the appropriate panorama. I suppose you could simply put the dropdown menu's X/Y off-stage, if you didn't want to see it.
Panorado
02-29-2008, 04:43 PM
I took your suggestions and tried to write some code but... to no avail... I ended up just making a button to make the larger thumbnails (blocking the screen), smaller. So, that works fine.
vBulletin® v3.7.1, Copyright ©2000-2010, Jelsoft Enterprises Ltd.