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

Tuesday, August 4th 2015, 11:54am

How to set autorotate's enabled with JS code

I add a hotspot in my pano

Source code

1
2
3
4
5
6
7
<hotspot name="hs1" style="polygonal_style" 
onclick="js(openFineView(1,'./popFineView/artworks/pic_a01/iViewer.xml',1,'初夏的黄连树',get(data[a01].content)));set(autorotate.enabled,false);"  >			
              <point ath="-149.304507" atv="-6.413643" />			
              <point ath="-140.364913" atv="-6.940917" />			
              <point ath="-140.207234" atv="0.973232" />			
              <point ath="-149.500649" atv="0.883999" />		
</hotspot>


it will open a fullscreen window to show my pic,when I close this window,I want the autorotate.enabled set as true.
I tried this code in js:

Source code

1
2
3
4
5
6
7
8
9
    fineView.prototype.close = function() {
		 krpano.call("set(autorotate.enabled,true);");
		 var a = this.getDialogDiv();
 		 a.parentNode.removeChild(a); 
		 a = null;
 		 willAnimate = false;
 		 zoomIn = true;			 
                 this.closed = true;		 
};


But it didn't work,how should I do next?

2

Wednesday, August 5th 2015, 6:44am

Hi,
But it didn't work
Are there some Javascript errors?
e.g. is the krpano object already defined and available?

The code 'set(autorotate.enabled,true);' itself is correct and should work.

Best regards,
Klaus

3

Wednesday, August 5th 2015, 9:32am

Are there some Javascript errors?
HI klaus,Thank you for your reply

when I click the button,there's no javascipt errors come out,and it will close my window normally,but the pano will not autorotation after the window closed.
it just do not work

Source code

1
<img width="40px" height="40px" onclick="fineView.getInstance().close();" src="' + skinPath + 'close1.png"/>