You are not logged in.

6av16

Beginner

  • "6av16" started this thread

Posts: 6

Location: Kiel

Occupation: Industrial Designer

  • Send private message

1

Wednesday, November 18th 2020, 11:47am

Toggle Autotour with button?

Hi everyone,

I'm using the new Krpano 1.20.8. It has a nice feature that easily allows you to make an autotour from your virtual tour. However I haven't found a way to toggle that effect with a button. I can only activate it by either writing "true" or "false" in the skin settings of the tour.xml.
Is there a way to easily use a button as a layer that enables the user to switch it on or off during the tour? (I'm a newbie at coding)

There is an option to activate and deactivate the autotour by doing a right-click and selecting it in the drop down menu, basically I want exactly that option as a button in the virtual tour.

Thanks!

David

This post has been edited 1 times, last edit by "6av16" (Nov 18th 2020, 11:58am)


San7

Professional

Posts: 609

Occupation: coding in krpano

  • Send private message

2

Wednesday, November 18th 2020, 1:52pm

create a button and install onclick="switch(autorotate.enabled);"

3

Sunday, November 22nd 2020, 10:07am

Hi,

switching autorotate.enabled works, but there is also a slightly better solution:

Source code

1
onclick="if(autorotate.isrotating, autorotate.stop(), autorotate.start() );"


This way the autorotate/autotour starts instantly when enabling it, otherwise it would wait the waittime before it starts after enabling.

Documentation:
https://krpano.com/docu/xml/#autorotate.start

Best regards,
Klaus

panoyun

Intermediate

Posts: 228

Location: Somalia

  • Send private message

4

Monday, April 12th 2021, 10:15am

When I pause it, it will still start the rotation. I don't know why *smile*
onclick="if(autorotate.isrotating, autorotate.stop(), autorotate.start() );"

5

Monday, February 27th 2023, 11:52am

Hi,

switching autorotate.enabled works, but there is also a slightly better solution:

Source code

1
onclick="if(autorotate.isrotating, autorotate.stop(), autorotate.start() );"


This way the autorotate/autotour starts instantly when enabling it, otherwise it would wait the waittime before it starts after enabling.

Documentation:
https://krpano.com/docu/xml/#autorotate.start

Best regards,
Klaus

Hi Klaus,
this seams not to work when a waittime >1 is active.
Do you have a solution?

My Code:

Source code

1
2
3
4
<events onloadcomplete="set(autorotate.enabled,true);autorotate.start();" />
 <autorotate enabled="true" waittime="5" /> 

<layer name="skin_btn_autorotate"  onclick="if(autorotate.isrotating, autorotate.stop(), autorotate.start() );" />

David_smith

Beginner

Posts: 3

Location: United States

Occupation: Digital Marketer and an Entrepreneur

  • Send private message

6

Tuesday, March 21st 2023, 8:31pm

Yes, it is possible to create a button in Krpano that toggles the autotour feature on and off. You can do this by adding a button layer to your virtual tour and attaching an onclick event that toggles the value of the "autorotate.enabled" variable between "true" and "false
https://sturdybusiness.com -Sturdy Business helps small businesses grow faster with best practices (without breaking the bank).