shock
(Adrian)
March 29, 2022, 3:09pm
1
hello everyone, check other threads but I don't see it as it happens to me
In order to optimize, I divided my website into 10 scenes, into individual files, each one created its own html, I'm trying to link from one scene to another scene (html) but in an anchor position.
The action of the button is "go to url" institutional.html#tecnologiasD
reaches the html, but not the anchor
does anyone know what is wrong?
MarkHunte
(Mark Hunte)
March 29, 2022, 3:31pm
2
See the first part of this post.
Tumult Hype documents are accessible from a single URL. If you name your document 'Flying' and upload it to your site, then your animation and all its scenes are accessible from http://example.com/flying.html (unless you change the name of your exported .html file).
This article describes three ways to navigate between scenes:
Load a scene directly from a URL (For example: http://site.com/hypedocument.html#contact )
Use a button outside of your Tumult Hype document to load a scene in that docu…
Also
I am guessing it may be a timing-based behavior difference. Hype dynamically creates its HTML, and Safari may be trying to go to the anchor before it exists (without trying again when it is shortly thereafter made).
If @daniel 's suggstion doesn't work, you could try adding a Run JavaScript action to the first On Scene Load handler in the Scene Inspector to run code like:
if(location.hash != "") {
location.href = location.hash;
}
This will just reset the URL to that of the hash and should mak…
You may actually only need the second post and the code @jonathan offers.
Archive.zip (357.9 KB)
But an example doc of your project setup would help to help you further.
1 Like
shock
(Adrian)
March 29, 2022, 8:55pm
3
first of all .. thank you very much, I managed to bring the html in the anchor position. but now i have another problem.
I am using this script that allows me to change the height of the page in a variable way, since it varies according to the width of the browser
<script>
function layoutRequest(hypeDocument, element, event) {
//returns [{name: xxx; height:xxx; width:xxx; breakpoint: xxx}, ...]
var _layouts = hypeDocument.layoutsForSceneNamed(hypeDocument.currentSceneName());
//currentLayoutname
var layoutName = hypeDocument.currentLayoutName();
//get data for current Layout -> {name: xxx; height:xxx; width:xxx; breakpoint: xxx}
var res = null;
for (var i = 0; i < _layouts.length; i++) {
var Obj = _layouts[i];
if (Obj.name === layoutName) {
res = Obj;
break;
}
}
// set hypeDocumentElement height depending on layoutratio ...
if (res) {
var ratioScale = res['width'] / res['height'];
var hypeEl = document.getElementById(hypeDocument.documentId());
var currentWidth = hypeEl.offsetWidth;
var newHeight = currentWidth / ratioScale;
hypeEl.style.height = newHeight + 'px';
hypeDocument.relayoutIfNecessary();
}
return false
}
if ("HYPE_eventListeners" in window === false) {
window.HYPE_eventListeners = Array();
}
window.HYPE_eventListeners.push({
"type": "HypeLayoutRequest",
"callback": layoutRequest
});
</script>
but going to page.html#anchor does not load the entire page
I leave you a link where you can see it, in the home you must click on the yellow button +informacion
http://shockmultimedios.com/cabac/