Jump to content

Superior_Nexus

Members
  • Posts

    5
  • Joined

  • Last visited

Superior_Nexus's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hmmm.. i still don't really understand. I'll keep re-reading to see if it helps.
  2. hmmm.. i think i understand. soo.. how would i write that? <script> function menu() { if x.width = "20%" { x.style.width = "0%"; } I know the code is not complete, but I want to learn first. So, would that be the way to do it?
  3. Sorry, I didn't really know how to word it. But i suppose what I am looking for is to be able to use the "if..else" condition, to make the button "open" and "close" the side bar that i have made.. with the current JS that i have(posted above in orig. post), i am able to "open" the menu, but i want to learn and be able to close it with the same button.. I don't know how to do that with javascript.. I don't know how to use the "if..else" condition, the article on the site is confusing to me. Sorry for the hassle.
  4. The thing is, I tried using the IF condition, but then I get confused on how to make it work properly. To be honest, I don't even really know how to set up the IF condition with the code I'm using. If you'd be so willing to help me, and explain it in simpler terms, I'd be so grateful.
  5. Hello! I am Superior_Nexus. I am new here, as I am new to the whole scripting scene. My question is, can somebody help me with this little piece of JavaScript code!? Please. I read the article on www.w3schools.com many times, and I just don't understand it. I want to make the button work both ways, "forwards" and "backwards". I have the "forward" done, now I just ask for help in setting up the "backwards" part. I will only post my javascript code for now, but if you need more, then i'll be happy to post that too. Note: I am not a professional by any means, and my code is probably the poorest some of you have ever seen, I do this for fun. Here is my code. <script>function menu() {var x = document.getElementById("hidden_menu");x.style.width = "20%";x.style.transition = "width 1s";var x = document.getElementById("wrapper");x.style.width = "80%";x.style.transition = "width 1s";}</script> How would I get this button to reverse this action? Thank you in advance!
×
×
  • Create New...