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.

1

Wednesday, June 22nd 2016, 12:36pm

Showtext plugin question

Hello all!
Have a small question.
I use showtext plugin for showing hotspot cards like text cards on yandex or google maps. Right now i want to use it by clicking on hotspot.

Source code

1
krpano.set("hotspot[" + response.data[i].id + "].ondown", "showtext(" +					"[div style='padding: 5px 10px']" +						"[h2 style='width: 100%; margin: 0;']" +  response.data[i].name + "[/h2][br]" +						"[img style='width: 100%' src='" + response.data[i].pic + "'  alt='' /][br]" +					"[/div]  ,CARDSTYLE)");


It works with "onhover" but when i click on it with "onclick" it shows and immideatly dissapears. How can i get it work? How can i use onclick with showtext work on it, and how can i close showtext plugin when i tap on it?

2

Wednesday, June 29th 2016, 11:29am

Hi,

the showtext() action isn't made for such.

It immediately disappears because the default showtime value is 0.1 seconds:
http://krpano.com/plugins/showtext/#textstyle

For showing a text on click and hiding it on another click on it, the textfield plugin should be used:
http://krpano.com/plugins/textfield/#top

Best regards,
Klaus