Position entire scene to the left/top


(Carlos Eduardo) #1

I work animating banners, so every time I finish animating a group of banners I have to open each HTML and remove the “position:absolute” or “position:relative” from the code because that puts my scene in the center of the page, when it should be at the left-top.

There’s a “position left-top with CSS” button on hype, but I don’t really know what it does, cause here, it doesn’t do anything.


#2

Hi @Carlosnewblue,

I appreciate the frustration.

To answer your query about “position left-top with CSS” … this is in regards to animations that are manipulated via Javascript not for position of the document or scene.

Also if you want to run a small function on scene load for your documents you can reset the margin value which is making the scene sit in the centre of the page. (saves you having to re-open and remove positioning)

document.getElementById(hypeDocument.documentId()).style.margin = "0";

What this does is get the id of your Hype document and sets the margin value to 0px instead of the default auto. Thus, your document should now set itself in reference to the top / left of the screen.


(Carlos Eduardo) #3

Oh dude! Thank you for that function. That really fixes it. Thank you so
much!

One thing I’m really liking about Hype, is this Forum/Community. It’s great
to have people helping out.