How can I change the Scene size by JavaScript


#1

I want to do that change the Scene Height when more content is be loading. I does’t find the API.


(Hans-Gerd Claßen) #2

document.getElementById(hypeDocument.documentId())

will return the hypeDocument

document.querySelector('#'+hypeDocument.documentId()+' > .HYPE_scene[style*="block"]');

will return the actual sceneelement

you can set the height by

yourElement.style.height = 'someNumberpx'

this is not supported by hype. so be sure of what your doing :slight_smile:


#3

The content of scene is table list which height is more than screen height, so I want modify the scene height when the scene’s content did loaded.

document.getElementById(hypeDocument.documentId())
will return the hypeDocument
document.querySelector(’#’+hypeDocument.documentId()+’ > .HYPE_scene[style*=“block”]’);
will return the actual sceneelement
you can set the height by
yourElement.style.height = ‘someNumberpx’

Can I use the above code by hype ?


(Hans-Gerd Claßen) #4

¿

the above is not a readymade solution … if you mean that.

you’ve got to

  1. setup an eventlisteners (sceneload, what happens on resize, scene or layoutchange …)
  2. get height of the table
  3. calculate necessary height of a scene
  4. set document AND sceneheight
  5. react on changes (reset etc. …)