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.

andrew22222

Intermediate

  • "andrew22222" started this thread

Posts: 341

Location: Australia

  • Send private message

1

Tuesday, January 19th 2010, 4:10am

Hotspot to open specific size URL page

Hi,

I'm really not too clever with code and was hoping to get a hotspot within the panorama to open an external web page but at a specific size and with scrollbars. Using the code below i can get the page to load no problem in a new window but the size part is totally ignored.

Source code

1
onclick="openurl(http://www.mywebsite.com/information/whales_breeding.html, _blank,width=500,height=530);"


Reading the forums it mentions adding javascript to the html page but I don't have coding access to the actual target page and the site designers would make it really difficult for me to change it. (business politics *confused* )

Is there anything I can add to my onclick= code above to load that target page at 500 X 530 or am I dreaming and just be thankful it opens at all?

Look forward to any help please.

Thanks,

Andrew

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

2

Tuesday, January 19th 2010, 5:07am

Hi,

Quoted

Reading the forums it mentions adding javascript to the html page but I don't have coding access to the actual target page....
The code must be on your html (the one of your current krpano) not on the target html page....

example of code:
xml:

Source code

1
onclick='js(mypopup(www.mywebsite.com/information/whales_breeding.html,500,530);)'

html javascript:

Source code

1
2
3
4
	function mypopup(url,width,height) {
		mywindow = window.open (url +"","mywindow","width="+width+",height="+height);
		mywindow.moveTo(0,0);
	} 


SAlut.

andrew22222

Intermediate

  • "andrew22222" started this thread

Posts: 341

Location: Australia

  • Send private message

3

Tuesday, January 19th 2010, 5:58am

Many thanks for the example. It works beautifully and opens the window at 500 X 530. Life is good once again *smile* Wow! I'm actually worse at the coding than I thought as for some reason I thought it had to be put in the target page.

I had to add http:// before the www as it seemed to be looking for the page on the same website as the virtual tour .

Can I please ask one more question regarding scroll bars? The target page has a large amount of text and images. The pop up window can be dragged down 'resized' to view most of it but I think visitors would prefer a scroll bar as they are used to them. Is it possible to tell the window to show a scroll bar in the code?

Cheers,

Andrew

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

4

Tuesday, January 19th 2010, 2:49pm

Hi Andrew,

Quoted

....would prefer a scroll bar.....
add scrollbars=yes as feature argument... Like this:

Source code

1
2
3
4
function mypopup(url,width,height) {
mywindow = window.open (url +"","mywindow","scrollbars=yes,width="+width+",height="+height);
mywindow.moveTo(0,0);
}


You can find more info here: https://developer.mozilla.org/en/DOM/window.open

SAlut.

andrew22222

Intermediate

  • "andrew22222" started this thread

Posts: 341

Location: Australia

  • Send private message

5

Tuesday, January 19th 2010, 6:06pm

Once again, worked beautifully. Many thanks for your time Michel. I appreciate it.

I bookmarked the link to help out with any future fun and games with coding.This has opened a whole new avenue for me as previous to this I had projects with hotspots that opened plugins which were in fact swf scrolling windows created in flash. They looked good but were so time consuming to create on a flash stage etc. With your sample code I can now create full html coded pages in Dreamweaver in considerably less time and link to those with specific sizes.

Just out of curiosity, where did you get your 'Donkey on the mans shoulders' image? I noticed it last night and laughed but unfortunately had a mouth full of coffee so had to clean up the monitor *g*

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

6

Tuesday, January 19th 2010, 6:52pm

Donkey on the mans shoulders image *smile* ... It is from a powerpoint I have received with many old fotos (I do not know the origin)... I saw this one and thought it could be a great avatar for me... It is like I am the Donkey that needs help to learn, and I am the soldier that carries the donkey trying to help him learning... as an autodidact...

Quoted

I noticed it last night and laughed but unfortunately had a mouth full of coffee so had to clean up the monitor *g*
*g* *g* *g* *thumbsup*

SAlut.

andrew22222

Intermediate

  • "andrew22222" started this thread

Posts: 341

Location: Australia

  • Send private message

7

Wednesday, January 20th 2010, 12:55am

Nice. it's an excellent picture and would love to see the full size version if you have it.

Well, thought I'd join in and just added my avatar via the profile settings. The picture says it all really *w00t*

Similar threads