Hey, so I’m making a multipage tablet-like MDT/CAD, and, I’ve setup NUI, got all of that working fine.
I’m now trying to have another page, as in, you click something on the home page, the home page disappears, and a new page appears on the tablet.
I’ve tried some ways to do this but im really not familiar enough with JS/CSS/HTML to do this confidently, and i figured rather than firing at a wall blind folded here, I would just ask.
So if anyone knows how to do this, please let me know
So if I understand you correctly, the first page that acts as an index page loads in. For the time being I’m going to call that file “index.html”.
Your next file called next.html is located on the same level where index.html? If yes, are you trying to call it like <a href="next.html">Link</a>?
Next thing I would check, if you would try to use next.html as the index page - instead of index.html - would that load the next.html's contents properly, or you get the same white bg?
Additionally, you might want to provide some code, to see what is going on, maybe you are missing a closing tag, etc.
Fairly certain with NUI you can’t just link to other HTML pages, so you either have to embed them using iframes, include it all into a single html page and just add wrapper divs to control visibility, figure out if you can get something like jQuery .load() to work, or learn a modern front-end framework or library like Vue, Angular, or React and make use of their routing.
in my css file was messing it up, but, I use that piece of CSS to stop the tablet displaying on resource start. To get all href links working i need to remove that, but, then when the resource starts, the tablet is automatically displayed…
Put the overflow and display properties into a class, like
.hidden {
overflow: hidden;
display: none;
}
and use jQuery (or vanilla JS if you prefer that) to toggle this class on the body tag, so you can put the class="hidden" on the index’s body by default, so it doesn’t display automatically, then do the rest with JS.