+ 6
how to create multiple html pages in "sololearn's playground"?
I am thinking of making a game and I need to make more than one page for the game, for example one page for menu which leads to the other page containing the game itself
18 Réponses
+ 9
e.g.
<nav>
<ul>
<li><a href="_____">home</a</li>
<li><a href="_____">page1</a></li>
<li><a href="_____">page2</a></li>
<li><a href="_____">page3</a></li>
<li><a href="_____">page4</a></li>
</ul>
</nav>
then you can style out with CSS
+ 6
You could make a navigation bar or at least a few links
+ 6
so do you know the answer @abdel
+ 6
Would make a function and make it disappear
+ 6
alright but you can't link one playground to the other could ya?
+ 5
but how ? 🤔
+ 5
my bad thx anyway
+ 5
bruh maybe there isnt
+ 5
already done that @abdel ;)
var page1 = document.getElementById("page1").style.display = "none";
var main_page = document.getElementById("main_page").style.display = "initial";
function change2pg1() {
var main_page = document.getElementById("main_page").style.display = "none";
var page1 = document.getElementById("page1").style.display = "initial";
}
+ 5
no worries @abdel
+ 4
@raithen can u code an example for me?
+ 2
Just google 'Javascript Screen Manager', you'll find something. I don't have time right now, sorry. Hope that helps.
+ 2
interesting question @Retro
+ 2
Sorry @Retro ,
but I spent 20 minutes or more trying to find out out how
+ 2
I created a function to make the text disappear when on clicked it but didn't work .
please give time and I'll find out how in the next 24hrs (insha Allah )
+ 1
One option is to write a screen-manager function that calls addClass to collection of elements (or 'page') and removes the class from the current elements. Thus, showing the new page, and hiding the old page. The pages start with opacity=0 and the class you add has opacity=1.
+ 1
@Retro , almost the same as I did .
keep taking it serious , I'll do in my part
+ 1
finally I got it but still working on it .
I'll post it for you tomorrow @Retro