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.

    Code
    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

  • Hi,

    Quote

    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:

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


    html javascript:

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

    SAlut.

  • 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

  • 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*

  • 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...

    Quote

    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.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!