Print at Dec 18, 2025, 9:39:17 PM
Posted by Gildaniel at Feb 26, 2020, 11:05:33 AM
Need help - viewHomeInNewTabFullBrowerWindow script
Dear Colleagues, experienced in JavaScript sweethome lovers!

Could you please help me to adopt viewHomeInOverlay script, to see sh3d model online in full browser window, like model shows in Online Viewer? http://www.sweethome3d.com/viewHome.jsp?id=887

Exploring models online in framed overlay there are some incommodities to face:

With smartphones:
- too small window of 3d viewer, especially in vertical mode;
- if you ocasionally tap somewhere outside overlay window boundaries - it closes viewer.

With desktops:
- using mouse wheel without Shift button in some browsers scrolls the html page instead of zooming 3d (in aerial mode) or moving through (in virtual visit mode)
- also occasion tapping outside closes overlay.


Here http://www.sweethome3d.com/support/forum/viewthread_thread,6708_offset,70#45816 Puybaret advised me to make some code changes; but after I import script and done it all navigation (aerial/virtual, levels) gone from the page, and my programming experience is not so good to correct it and compile new script :(

Can somebody help, to correct the code of viewHomeInOverlay and compile script, opening sh3d on a new tab to full browser window with navigation elements?

Posted by Puybaret at Feb 27, 2020, 3:10:37 PM
Re: Need help - viewHomeInNewTabFullBrowerWindow script
The Online viewer doesn't use viewHomeInOverlay but viewHome. If you want to inspire yourself from that viewer, just look at its source code!
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by Gildaniel at Feb 27, 2020, 7:53:38 PM
Re: Need help - viewHomeInNewTabFullBrowerWindow script
Unfortunately, reading viewhome.js did not make the question more clear for me.

May be SweetHome3DJSViewer.html even better suits for "full screening"; but all my attempts to tie canvas size to innerHeight and innerHeight, 100%, 100vh/100vw made it even smaller :( https://woodmouse.ru/test/view/test.html

There is a way of adaptive full screen canvas alinement - https://stackoverflow.com/questions/4288253/h...-width-height-of-viewport

Is it possible to use this method in SweetHome3DJSViewer.html?

Yours, Daniel

Posted by Gildaniel at Feb 27, 2020, 8:08:10 PM
Re: Need help - viewHomeInNewTabFullBrowerWindow script
Next my step - I found function "window.onresize = function(ev)" in html of Online Viewer, and insert this script to SweetHome3DJSViewer.html

It almost works and reacting to browser resizing, but with mistakes.. ufffffff
https://woodmouse.ru/test/view/test2.html

Posted by Gildaniel at Mar 13, 2020, 8:00:53 AM
Re: Need help - viewHomeInNewTabFullBrowerWindow script
It was hard, but solved

https://woodmouse.ru/3dplan/iek/5i.html

Posted by Gildaniel at Mar 13, 2020, 9:28:54 AM
Re: Need help - viewHomeInNewTabFullBrowerWindow script
Calling to the new browser window with button from https://woodmouse.ru/3dplan/iek/5.html

Posted by Puybaret at Mar 13, 2020, 5:48:00 PM
Re: Need help - viewHomeInNewTabFullBrowerWindow script
Congratulations! smile
Handling window space is really not the easiest thing in JavaScript...
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator