How to change name of container id after advanced export


#1

How can you change the id of the container when exporting an animation?

I have a web page that contains multiple Hype exported animations. But I think because they have the same container id, it causes problems.


#2

I recommend exporting with separate names during export if you need multiple different Hype documents on the same page. Are you accessing the ID with JavaScript somehow? If you change the container ID after export, the Hype JavaScript will not know what container to use and it will fail.

Also, I recommend using a CDN URL for the Hype runtime to avoid downloading that file more than once.


#3

Hi Daniel, we’re indeed exporting the hype documents with different names. However, Hype gives them all the container id div id=“default_hype_container”.

I don’t think it’s possible to just change the container id by hand. It would be possible to do this in the html code referencing the Hype javascript file. But default_hype_generated_script.js also contains the container id, and we can’t just change it in that file.

The page that has multiple Hype documents: Hype animation 1 seems to adopt from Hype animation 2, I guess because they have the same container id.


#4

Are you exporting using an Export script? The ID of the div should be prepended with the document name (or filename chosen during export). (Using Hype 1.6.2 and Hype 3.6.3)

If you export using the name xxxx, the Div id will be: xxxx_hype_container.


#5

No, I’m using “Advanced export” in Hype:

  • Custom slices: Default
  • Export script: None
  • Individual slices: none selected

It then exports in a folder (which is the name I’ve given the Hype document). In that folder there’s index.html and a folder called Default with all the other files.


#6

The default name comes from the default name (which is Default) you have set for the slice. Double click on that to rename, or export individual scenes (which will use their scene name as the slice + export name)