Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
Java and css help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="FirefighterKyle" data-source="post: 396696" data-attributes="member: 22469"><p>Hello everyone I have been working on a site for myself for a good 4 hours. I ran across some problems but fixed most of it if you wish to view my failure in the beginning feel free to scroll to the bottom. (I am leaving it up so other can see what I have redone etc so hopefully it will help them also.)</p><p></p><p>So lets kick off from here. </p><p>I am still running into one error which I can not seem to fix but I guess with time I will figure it out if no one steps in to assist me but either way here is my Style, Script, HTML, and some pictures of it all also.</p><p></p><p>[SPOILER="Style"]</p><p>[CODE]<style></p><p>.container {</p><p> display: inline-block;</p><p> cursor: pointer;</p><p> float: right;</p><p>}</p><p></p><p>.bar1, .bar2, .bar3 {</p><p> width: 35px;</p><p> height: 5px;</p><p> background-color: #333;</p><p> margin: 4px 0;</p><p> transition: 0.4s;</p><p> </p><p>}</p><p></p><p>.change .bar1 {</p><p> -webkit-transform: rotate(-45deg) translate(-8px, 4px) ;</p><p> transform: rotate(-45deg) translate(-8px, 4px) ;</p><p>}</p><p></p><p>.change .bar2 {opacity: 0;}</p><p></p><p>.change .bar3 {</p><p> -webkit-transform: rotate(45deg) translate(-8px, -6px) ;</p><p> transform: rotate(45deg) translate(-8px, -6px) ;</p><p>}</p><p></p><p>.icon-bar {</p><p> </p><p> transition: all 0.3s ease;</p><p> color: black;</p><p> font-size: 16px;</p><p> float: right;</p><p> margin-right: 4px;</p><p></p><p>}</p><p> </p><p>ul.tab {</p><p> list-style-type: none;</p><p> margin: 0;</p><p> padding: 0;</p><p> overflow: hidden;</p><p>}</p><p></p><p>/* Float the list items side by side */</p><p>ul.tab li {float: right;}</p><p></p><p>/* Style the links inside the list items */</p><p>ul.tab li a {</p><p> display: inline-block;</p><p> color: black;</p><p> text-align: center;</p><p> padding: 14px 16px;</p><p> text-decoration: none;</p><p> transition: 0.3s;</p><p> font-size: 17px;</p><p>}</p><p></p><p></p><p></p><p></p><p></p><p>/* Style the tab content */</p><p>.tabcontent {</p><p> display: none;</p><p> padding: 6px 12px;</p><p> float: right;</p><p>}</p><p></p><p>.topright {</p><p> float: right;</p><p> cursor: pointer;</p><p> font-size: 20px;</p><p>}</p><p></p><p>.topright:hover {color: red;}</p><p></style>[/CODE]</p><p>[/SPOILER]</p><p></p><p>[SPOILER="Script"]</p><p>[CODE]<script></p><p>function myFunction(x) {</p><p> x.classList.toggle("change");</p><p>}</p><p></p><p></script></p><p></p><p><script></p><p>function openCity(evt, cityName) {</p><p> var i, tabcontent, tablinks;</p><p> tabcontent = document.getElementsByClassName("tabcontent");</p><p> for (i = 0; i < tabcontent.length; i++) {</p><p> tabcontent[i].style.display = "none";</p><p> }</p><p> tablinks = document.getElementsByClassName("tablinks");</p><p> for (i = 0; i < tablinks.length; i++) {</p><p> tablinks[i].className = tablinks[i].className.replace(" active", "");</p><p> }</p><p> document.getElementById(cityName).style.display = "block";</p><p> evt.currentTarget.className += " active";</p><p>}</p><p></p><p></p><p></script>[/CODE]</p><p>[/SPOILER]</p><p></p><p>[SPOILER="HTML"]</p><p>[HTML]<body></p><p></p><p> <img src="{url}/app/tpl/skins/Web/template/image/logo.png" style="float:left;"></img></p><p> <div class="container" onclick="myFunction(this);openCity(event, 'Phone');"></p><p> <div class="bar1"></div></p><p> <div class="bar2"></div></p><p> <div class="bar3"></div></p><p> </div></p><p> <i class="fa fa-phone icon-bar"> Phone numbers</i></p><p> <ul class="tab"></p><p></p><p></p><p></p><p><div id="Phone" class="tabcontent"></p><p> <span onclick="this.parentElement.style.display='none'" class="bar1 bar3">_______</span></p><p> <h3>Area / Place</h3></p><p> <p>This number is?</p></p><p></div>[/HTML]</p><p>[/SPOILER]</p><p></p><p>So that is all the codes out of the way!</p><p>Here are some images of it sort of working.</p><p><img src="http://image.prntscr.com/image/31b64009b8914c68b3f01d0bc98378ca.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p></p><p></p><p><img src="http://image.prntscr.com/image/7e3c134e42e549a0a58a42e6cb77fecf.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>As you can see it shows up now when I click the menu bar, only problem now is when I click the menu x it does not close it which I am trying to do. I have to click the dark gray underline (what I want to remove and avoid). Also would like to know how to make it so the h3 and text, go below the menu X. Once again thanks for viewing and for the help.</p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p style="text-align: center"><strong>Old stuff</strong></p><p>Alright so I am working on a site trying to make it professional which is my first mistake haha. Anyways, I am trying to make a 3 dash menu line which I have made, I am trying to make it so if you click it, it will show a text etc.</p><p></p><p>Also want to know how to make the image / logo type thing to fit next to it.</p><p></p><p><img src="http://image.prntscr.com/image/a7a43bed343b42338b775071b1407ee1.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> So here is the image of what I am working on.</p><p></p><p>I need help with the phone icon with the text (Phone numbers) next to the menu to the left preferably</p><p>also want to know how to hide the Place/Area with the phone # until you click on the menu.</p><p></p><p>[SPOILER="Style Codes"]</p><p>.container {</p><p> display: inline-block;</p><p> cursor: pointer;</p><p> float: right;</p><p>}</p><p></p><p>.bar1, .bar2, .bar3 {</p><p> width: 35px;</p><p> height: 5px;</p><p> background-color: #333;</p><p> margin: 4px 0;</p><p> transition: 0.4s;</p><p></p><p>}</p><p></p><p>.change .bar1 {</p><p> -webkit-transform: rotate(-45deg) translate(-9px, 4px) ;</p><p> transform: rotate(-45deg) translate(-9px, 4px) ;</p><p>}</p><p></p><p>.change .bar2 {opacity: 0;}</p><p></p><p>.change .bar3 {</p><p> -webkit-transform: rotate(45deg) translate(-8px, -6px) ;</p><p> transform: rotate(45deg) translate(-8px, -6px) ;</p><p>}</p><p></p><p>.icon-bar {</p><p></p><p> transition: all 0.3s ease;</p><p> color: white;</p><p> font-size: 46px;</p><p>[/SPOILER]</p><p></p><p>[SPOILER="Script Code"]</p><p>function myFunction(x) {</p><p> x.classList.toggle("change");</p><p> var i, tabcontent, tablinks;</p><p></p><p></p><p> document.getElementById(phone).style.display = "block";</p><p> evt.currentTarget.className += " active";</p><p>}</p><p>[/SPOILER]</p><p></p><p>Also here is the extra links etc etc.</p><p>[SPOILER="links"]<link rel="stylesheet" href="<a href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" target="_blank">https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css</a>">[/SPOILER]</p><p></p><p>Then here is my html codes.</p><p>[SPOILER="Html"]</p><p>[HTML]<div class="container" onclick="myFunction(this)"><i class="fa fa-phone"> Phone numbers</i></p><p> <div class="bar1"></div></p><p> <div class="bar2"></div></p><p> <div class="bar3"></div></p><p> <h3>Place/Area</h3></p><p> <p>Phone #</p></p><p> </div>[/HTML]</p><p>[/SPOILER]</p><p></p><p></p><p></p><p>_______________________________________________________________________________________________________________<strong>Update</strong></p><p>New Styles [SPOILER="Style"]</p><p>[CODE]<style></p><p>.container {</p><p> display: inline-block;</p><p> cursor: pointer;</p><p> float: right;</p><p>}</p><p></p><p>.bar1, .bar2, .bar3 {</p><p> width: 35px;</p><p> height: 5px;</p><p> background-color: #333;</p><p> margin: 4px 0;</p><p> transition: 0.4s;</p><p></p><p>}</p><p></p><p>.change .bar1 {</p><p> -webkit-transform: rotate(-45deg) translate(-8px, 4px) ;</p><p> transform: rotate(-45deg) translate(-8px, 4px) ;</p><p>}</p><p></p><p>.change .bar2 {opacity: 0;}</p><p></p><p>.change .bar3 {</p><p> -webkit-transform: rotate(45deg) translate(-8px, -6px) ;</p><p> transform: rotate(45deg) translate(-8px, -6px) ;</p><p>}</p><p></p><p>.icon-bar {</p><p></p><p> transition: all 0.3s ease;</p><p> color: white;</p><p> font-size: 46px;</p><p>}</p><p></p><p>ul.tab {</p><p> list-style-type: none;</p><p> margin: 0;</p><p> padding: 0;</p><p> overflow: hidden;</p><p>}</p><p></p><p>/* Float the list items side by side */</p><p>ul.tab li {float: right;}</p><p></p><p>/* Style the links inside the list items */</p><p>ul.tab li a {</p><p> display: inline-block;</p><p> color: black;</p><p> text-align: center;</p><p> padding: 14px 16px;</p><p> text-decoration: none;</p><p> transition: 0.3s;</p><p> font-size: 17px;</p><p>}</p><p></p><p></p><p></p><p></p><p></p><p>/* Style the tab content */</p><p>.tabcontent {</p><p> display: none;</p><p> padding: 6px 12px;</p><p>}</p><p></p><p>.topright {</p><p> float: right;</p><p> cursor: pointer;</p><p> font-size: 20px;</p><p>}</p><p></p><p>.topright:hover {color: red;}</p><p></style>[/CODE]</p><p>[/SPOILER]</p><p></p><p>Redone Script [SPOILER="Script"]</p><p>[CODE]</p><p><script></p><p>function myFunction(x) {</p><p> x.classList.toggle("change");</p><p>}</p><p></p><p></script></p><p></p><p><script></p><p>function openCity(evt, cityName) {</p><p> var i, tabcontent, tablinks;</p><p> tabcontent = document.getElementsByClassName("tabcontent");</p><p> for (i = 0; i < tabcontent.length; i++) {</p><p> tabcontent[i].style.display = "none";</p><p> }</p><p> tablinks = document.getElementsByClassName("tablinks");</p><p> for (i = 0; i < tablinks.length; i++) {</p><p> tablinks[i].className = tablinks[i].className.replace(" active", "");</p><p> }</p><p> document.getElementById(cityName).style.display = "block";</p><p> evt.currentTarget.className += " active";</p><p>}</p><p></p><p></p><p></script>[/CODE]</p><p>[/SPOILER]</p><p></p><p>New Html [SPOILER="HTML"]</p><p>[HTML]<div class="container" onclick="myFunction(this)" ><i class="fa fa-phone"> Phone number</i></p><p> <div class="bar1"></div></p><p> <div class="bar2"></div></p><p> <div class="bar3"></div></p><p> </div></p><p></p><p> <ul class="tab"></p><p></p><p> <li><a href="javascript:void(0)" onclick="openCity(event, 'Phone')">Area</a></li></p><p></ul></p><p></p><p></p><p></p><p><div id="Phone" class="tabcontent"></p><p> <span onclick="this.parentElement.style.display='none'" class="topright">x</span></p><p> <h3>Area</h3></p><p> <p>Phone number.</p></p><p></div>[/HTML]</p><p>[/SPOILER]</p><p></p><p>The link stayed the same.</p><p></p><p>Alright so tried to redo somethings,</p><p> <img src="http://image.prntscr.com/image/d0ba6d99ded44845880c4a307d2d4617.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> So still couldn't figure out how to move the telephone icon with the text (Phone numbers) to the left next to the menu. Also have a link Phone there for a drop thing.</p><p></p><p>So my 3 dash menu has a function which turns into an X. What I want to do is remove the link Phone and have it so you can click the menu and it will show the text without having the link Phone to show it.</p><p></p><p><img src="http://image.prntscr.com/image/44043cfe0118418891bf67e723305dbc.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>That is with me clicking the Phone what is to the left of the menu which I am trying to make it so the phone icon with the text (Phone number) there.</p><p></p><p>Also that is what it does when I click the link Phone it will show that h2 + text which I just want to click the menu to do that with out that little x in the right corner.</p><p></p><p>Here is a picture of what my menu does.</p><p><img src="http://image.prntscr.com/image/1d7fa404f76c45ebaea071df7d9786ca.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>So as I said many times which I apologize for, is that I am trying to make it so I can just click the menu to show the Area / Place with the text (the number is?)</p><p></p><p>Then when you click the menu what turned into an x it will make the h2 + text disappear.</p><p> I know it's a lot to read but thank you for anyone who can assist me.</p></blockquote><p></p>
[QUOTE="FirefighterKyle, post: 396696, member: 22469"] Hello everyone I have been working on a site for myself for a good 4 hours. I ran across some problems but fixed most of it if you wish to view my failure in the beginning feel free to scroll to the bottom. (I am leaving it up so other can see what I have redone etc so hopefully it will help them also.) So lets kick off from here. I am still running into one error which I can not seem to fix but I guess with time I will figure it out if no one steps in to assist me but either way here is my Style, Script, HTML, and some pictures of it all also. [SPOILER="Style"] [CODE]<style> .container { display: inline-block; cursor: pointer; float: right; } .bar1, .bar2, .bar3 { width: 35px; height: 5px; background-color: #333; margin: 4px 0; transition: 0.4s; } .change .bar1 { -webkit-transform: rotate(-45deg) translate(-8px, 4px) ; transform: rotate(-45deg) translate(-8px, 4px) ; } .change .bar2 {opacity: 0;} .change .bar3 { -webkit-transform: rotate(45deg) translate(-8px, -6px) ; transform: rotate(45deg) translate(-8px, -6px) ; } .icon-bar { transition: all 0.3s ease; color: black; font-size: 16px; float: right; margin-right: 4px; } ul.tab { list-style-type: none; margin: 0; padding: 0; overflow: hidden; } /* Float the list items side by side */ ul.tab li {float: right;} /* Style the links inside the list items */ ul.tab li a { display: inline-block; color: black; text-align: center; padding: 14px 16px; text-decoration: none; transition: 0.3s; font-size: 17px; } /* Style the tab content */ .tabcontent { display: none; padding: 6px 12px; float: right; } .topright { float: right; cursor: pointer; font-size: 20px; } .topright:hover {color: red;} </style>[/CODE] [/SPOILER] [SPOILER="Script"] [CODE]<script> function myFunction(x) { x.classList.toggle("change"); } </script> <script> function openCity(evt, cityName) { var i, tabcontent, tablinks; tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } tablinks = document.getElementsByClassName("tablinks"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } document.getElementById(cityName).style.display = "block"; evt.currentTarget.className += " active"; } </script>[/CODE] [/SPOILER] [SPOILER="HTML"] [HTML]<body> <img src="{url}/app/tpl/skins/Web/template/image/logo.png" style="float:left;"></img> <div class="container" onclick="myFunction(this);openCity(event, 'Phone');"> <div class="bar1"></div> <div class="bar2"></div> <div class="bar3"></div> </div> <i class="fa fa-phone icon-bar"> Phone numbers</i> <ul class="tab"> <div id="Phone" class="tabcontent"> <span onclick="this.parentElement.style.display='none'" class="bar1 bar3">_______</span> <h3>Area / Place</h3> <p>This number is?</p> </div>[/HTML] [/SPOILER] So that is all the codes out of the way! Here are some images of it sort of working. [IMG]http://image.prntscr.com/image/31b64009b8914c68b3f01d0bc98378ca.png[/IMG] [IMG]http://image.prntscr.com/image/7e3c134e42e549a0a58a42e6cb77fecf.png[/IMG] As you can see it shows up now when I click the menu bar, only problem now is when I click the menu x it does not close it which I am trying to do. I have to click the dark gray underline (what I want to remove and avoid). Also would like to know how to make it so the h3 and text, go below the menu X. Once again thanks for viewing and for the help. [CENTER][B]Old stuff[/B][/CENTER] Alright so I am working on a site trying to make it professional which is my first mistake haha. Anyways, I am trying to make a 3 dash menu line which I have made, I am trying to make it so if you click it, it will show a text etc. Also want to know how to make the image / logo type thing to fit next to it. [IMG]http://image.prntscr.com/image/a7a43bed343b42338b775071b1407ee1.png[/IMG] So here is the image of what I am working on. I need help with the phone icon with the text (Phone numbers) next to the menu to the left preferably also want to know how to hide the Place/Area with the phone # until you click on the menu. [SPOILER="Style Codes"] .container { display: inline-block; cursor: pointer; float: right; } .bar1, .bar2, .bar3 { width: 35px; height: 5px; background-color: #333; margin: 4px 0; transition: 0.4s; } .change .bar1 { -webkit-transform: rotate(-45deg) translate(-9px, 4px) ; transform: rotate(-45deg) translate(-9px, 4px) ; } .change .bar2 {opacity: 0;} .change .bar3 { -webkit-transform: rotate(45deg) translate(-8px, -6px) ; transform: rotate(45deg) translate(-8px, -6px) ; } .icon-bar { transition: all 0.3s ease; color: white; font-size: 46px; [/SPOILER] [SPOILER="Script Code"] function myFunction(x) { x.classList.toggle("change"); var i, tabcontent, tablinks; document.getElementById(phone).style.display = "block"; evt.currentTarget.className += " active"; } [/SPOILER] Also here is the extra links etc etc. [SPOILER="links"]<link rel="stylesheet" href="[URL]https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css[/URL]">[/SPOILER] Then here is my html codes. [SPOILER="Html"] [HTML]<div class="container" onclick="myFunction(this)"><i class="fa fa-phone"> Phone numbers</i> <div class="bar1"></div> <div class="bar2"></div> <div class="bar3"></div> <h3>Place/Area</h3> <p>Phone #</p> </div>[/HTML] [/SPOILER] _______________________________________________________________________________________________________________[B]Update[/B] New Styles [SPOILER="Style"] [CODE]<style> .container { display: inline-block; cursor: pointer; float: right; } .bar1, .bar2, .bar3 { width: 35px; height: 5px; background-color: #333; margin: 4px 0; transition: 0.4s; } .change .bar1 { -webkit-transform: rotate(-45deg) translate(-8px, 4px) ; transform: rotate(-45deg) translate(-8px, 4px) ; } .change .bar2 {opacity: 0;} .change .bar3 { -webkit-transform: rotate(45deg) translate(-8px, -6px) ; transform: rotate(45deg) translate(-8px, -6px) ; } .icon-bar { transition: all 0.3s ease; color: white; font-size: 46px; } ul.tab { list-style-type: none; margin: 0; padding: 0; overflow: hidden; } /* Float the list items side by side */ ul.tab li {float: right;} /* Style the links inside the list items */ ul.tab li a { display: inline-block; color: black; text-align: center; padding: 14px 16px; text-decoration: none; transition: 0.3s; font-size: 17px; } /* Style the tab content */ .tabcontent { display: none; padding: 6px 12px; } .topright { float: right; cursor: pointer; font-size: 20px; } .topright:hover {color: red;} </style>[/CODE] [/SPOILER] Redone Script [SPOILER="Script"] [CODE] <script> function myFunction(x) { x.classList.toggle("change"); } </script> <script> function openCity(evt, cityName) { var i, tabcontent, tablinks; tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } tablinks = document.getElementsByClassName("tablinks"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } document.getElementById(cityName).style.display = "block"; evt.currentTarget.className += " active"; } </script>[/CODE] [/SPOILER] New Html [SPOILER="HTML"] [HTML]<div class="container" onclick="myFunction(this)" ><i class="fa fa-phone"> Phone number</i> <div class="bar1"></div> <div class="bar2"></div> <div class="bar3"></div> </div> <ul class="tab"> <li><a href="javascript:void(0)" onclick="openCity(event, 'Phone')">Area</a></li> </ul> <div id="Phone" class="tabcontent"> <span onclick="this.parentElement.style.display='none'" class="topright">x</span> <h3>Area</h3> <p>Phone number.</p> </div>[/HTML] [/SPOILER] The link stayed the same. Alright so tried to redo somethings, [IMG]http://image.prntscr.com/image/d0ba6d99ded44845880c4a307d2d4617.png[/IMG] So still couldn't figure out how to move the telephone icon with the text (Phone numbers) to the left next to the menu. Also have a link Phone there for a drop thing. So my 3 dash menu has a function which turns into an X. What I want to do is remove the link Phone and have it so you can click the menu and it will show the text without having the link Phone to show it. [IMG]http://image.prntscr.com/image/44043cfe0118418891bf67e723305dbc.png[/IMG] That is with me clicking the Phone what is to the left of the menu which I am trying to make it so the phone icon with the text (Phone number) there. Also that is what it does when I click the link Phone it will show that h2 + text which I just want to click the menu to do that with out that little x in the right corner. Here is a picture of what my menu does. [IMG]http://image.prntscr.com/image/1d7fa404f76c45ebaea071df7d9786ca.png[/IMG] So as I said many times which I apologize for, is that I am trying to make it so I can just click the menu to show the Area / Place with the text (the number is?) Then when you click the menu what turned into an x it will make the h2 + text disappear. I know it's a lot to read but thank you for anyone who can assist me. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Java and css help
Top