Ask coding questions

← Back to all posts
How do you make certain things NOT disappear?
Coder2404 (361)

So when you are on my homepage of my website there is going to be a sidebar, so when you press About on the sidebar it is going to lead to a file called About.html but the sidebar will disappear because it went to another file.How do you not make it disappear?

Answered by Baconman321 (1060) [earned 5 cycles]
View Answer
Comments
hotnewtop
Baconman321 (1060)

The sidebar is only coded in that file. What I recommend is making a JavaScript file that adds that sidebar to the html page. All you would have to do then is link that JavaScript file to both of the webpages.

If you want, I can help you with the JavaScript!

Coder2404 (361)

@Baconman321 Yes, please help me with the JavaScript

Baconman321 (1060)

@Coder2404 You would have to invite me to your repl.

Coder2404 (361)

@Baconman321 BUT PLEASE DON’T RUIN THE PROJECT!

Baconman321 (1060)

@Coder2404 Don't worry. You can use history if anyone deletes your progress.

Also you can uninvite me when you're done (which is great since I don't have to search through an ocean of invite requests to find the one I'm looking for).

Baconman321 (1060)

@Coder2404 Go to your repl. There should be a share button and a tab that will show an invites section. Type in my name and click "invite".

Just so you know I clicked your name as a test, so you should see what it looks like to be invited (I uninvited because it was kinda a mistake LOL)

Baconman321 (1060)

@Coder2404 Huh, they must be updating the interface...

:(

Coder2404 (361)

@Baconman321 I can see it...it happens sometimes...reload the page..

Coder2404 (361)

@Baconman321 it’s supposed to be on the bottom-right..

Baconman321 (1060)

@Coder2404 It doesn't work at all for me on any multiplayer repls.

I'm going to clear the data from repl.it hang on...

Baconman321 (1060)

@Coder2404 Yea it's not showing for me...

Baconman321 (1060)

@Coder2404 Does your website even have anything?

It's just a blank template...

Coder2404 (361)

@Baconman321 can you go to the repl, I invited you..

Baconman321 (1060)

@Coder2404 Please don't spam me.

If I don't respond it's most likely that I'm not active (I come in late on the weekends).

Sure, I'll join now....

Coder2404 (361)

@Baconman321 sorry I didn’t join, I was busy at the time

Baconman321 (1060)

@Coder2404 I'm available for about 20 minutes, but I'm not available tomorrow...

Coder2404 (361)

@Baconman321 Why aren’t you available tomorrow?
Btw I’m busy after 12, my time, 11 your time on weekends, on weekdays I’m available until 1:50, my time, 12:50, your time.

Baconman321 (1060)

@Coder2404 Ok...

I guess 12-1 your time would work.

Baconman321 (1060)

@Coder2404 I JUST GOT MENTIONED IN THE MONTHLY REPLS YAYYYY.

but otherwise I'm fine!

Coder2404 (361)

@Baconman321 thanks for helping me, I’m going to mark your comment as the answer!

Baconman321 (1060)

@Coder2404 Hey. You want to work or...?

Oh, nvm you got it...

Coder2404 (361)

@Baconman321 yeah I’m fine- but thanks for asking

RYANTADIPARTHI (6009)

you can easily try coding that sidebar into your about.html. just copy, and paste.

Coder2404 (361)

@RYANTADIPARTHI Well I don’t know how to make a sidebar only html

RYANTADIPARTHI (6009)

@Coder2404 so do you have a sidebar or not?

Coder2404 (361)

@RYANTADIPARTHI Yes I do but I can not make certain things NOT disappear...

RYANTADIPARTHI (6009)

@Coder2404 just copy and paste the sidebar code into the about file.

Coder2404 (361)

@RYANTADIPARTHI But the sidebar is made of html AND css

RYANTADIPARTHI (6009)

@Coder2404 put the css in the html file, inside style tags. easy!

Coder2404 (361)

@RYANTADIPARTHI but what does that have anything to do with my question?

RYANTADIPARTHI (6009)

@Coder2404 that says that the sidebar won't disappear.

ARPCW (0)

You have to make a the about page have the html code for the sidebar. In this example, you can see that there are two pages:
https://repl.it/@ARPCW/Side-Bar-with-about-page

InvisibleOne (2679)

in the html

<button onclick='appear()'>Click Me</button>

in the js

let hidden = false
function appear() {
  if (hidden == false) {
      document.getElementById('sidebar_id').style.display = 'none';
      hidden = true;
  } else {
      hidden = false;
      document.getElementById('sidebar_id').style.display = 'block';
}
InvisibleOne (2679)

Whoops I read your post wrong...
Just put the sidebar into each file

Zavexeon (1158)

Put it in both files.

Coder2404 (361)

@Zavexeon But my sidebar is going to need TWO files to make...