You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

to2hov

Trainee

  • "to2hov" started this thread

Posts: 55

Location: Bulgaria

Occupation: Panoramic Photography

  • Send private message

1

Wednesday, March 2nd 2011, 10:54am

Button switch

Hi there,

I made some sort of a single panorama with couple of hotspots which switch actions on clicks the code looks like that...

Source code

1
onclick="call(onclick_one);" onclick_one="set(onclick,call(onclick_two));" onclick_two="set(onclick,call(onclick_one));"


I have 11 hotspots with almost same parameters (accept ath and atv as well as the information) everything works ok so far... and you can see it here...

n.totuhov.com/istyle/

but after a few clicks it's all go a mess because the code remembers each button state of the click. So I tried variety of things like changing names from "click_one" "click_two" to "click_AA" "click_AB" and then I tried to simply switch all of them one by one it made my code huge but didn't work. I tried to set variable on first click and then check if this is the variable then means its first click and then set all to "click_AA, click_BA, click_CA," didnt work as well.

I acctually need some sort of state set to all hotspots to be "click_one" or "click_two"

Maybe I'm doing something wrong can anyone help? I will give more of the code if needed...

Thanks,
N.

2

Friday, March 4th 2011, 11:49am

Hi,

difficult to say but that amount of code

maybe try adding a kind of state attribute to each hotspot which indicates if the text is shown or not,
and on the hotspot click check for that state, and then closing the hotspot call an action where
all hotspots will be closed and the states of all hotspots will be set back to normal...

(btw - please don't use the Tools forum for Viewer questions, I have moved your thread now here)

best regards,
Klaus