Jump to content

Problems with Style display Property


Studio D

Recommended Posts

We're working with wordpress and the Laytheme Plugin and we're complete html beginners. But so far it went pretty well, we have a menu which is a accordion and a "About" text on top. Now we want to have a button over which you can use to hide both of them. So it was only possible to hide the accordion menu but not the text on top. (see screenshot)

For now it starts like that: 

<div><span class="oben">
     <input class="my-button" type="button" value="" onclick="myFunction()"> 

<div id="mycompany">
<p class="about">
    <a href="https://www.instagram.com" class="link">Link</a> is...text <a href="mailto:?Subject=Hello%20Diadem" target="_top" class="link">mail</a>
</p>

 <hr class="line2">
<hr.line2>
<button class="accordion">
                <a class="js-scrollTo" href="#title">
                <table> <tr>
                <td style="width:120px">TITLE</td>
                <td style="width:120px">EDITORIAL DESIGN</td>
                <td style="width:120px">320 PAGES</td>
                </tr>
                </table>
                </a>
                </button>

<div class="panel">

...more content

</div>

 

And the script is:

<script>
    function myFunction() {
  var x = document.getElementById("mycompany");
  if (x.style.display === "none") {
    x.style.display = "block";
  } else {
    x.style.display = "none";
  }
}

</script>

 

As you can see it's difficult for us to explain, we hope it's possible to understand and to help us out. We're getting desperate! 

web_screenshot.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...