My mobilefirst megamenu

<script src=""></script>
ul li{list-style-type: none;}
	/*	*/
        border: 1px solid red ;
<body onresize="myFunction()">

<p>Try to resize the browser window to display the windows height and width.</p>

<p id="demo"></p>
<div class="article">
<div class="dv1"><button class="btn2a">Slide down Drinkss</button></div>
<div class="dva">
	<h3>List of Drinks:</h3>
        <li><span>Coffee</span><button class="btn1a">Coffee</button></li>
        <li><span>Tea</span><button class="btn1a">Tea</button></li>
        <li><span>Coca Cola</span><button class="btn1a">Coca Cola</button></li>
<button class="btn1a">Slide up</button>
<div class="article">
<div class="dv1"><button class="btn2b">Slide down Alcohols</button></div>
<div class="dvb">
	<h3>List of Alcohols:</h3>
<button class="btn1b">Slide up</button>
<div class="article">
<div class="dv1"><button class="btn2c">Slide down Alcohols</button></div>
<div class="dvc">
	<h3>List of Drinks:</h3>
        <li>Coffee<button class="btn1c">Slide up</button></li>
        <li>Tea<button class="btn1c">Slide up</button></li>
        <li>Coca Cola<button class="btn1c">Slide up</button></li>
<button class="btn1c">Slide up</button>
<div class="article">
<div class="dv1"><button class="btn2d">Slide down Alcohols</button></div>
<div class="dvd">
	<h3>List of Alcohols:</h3>
<button class="btn1d">Slide up</button>
<button class="btn1">Slide up</button>
<button class="btn2">Slide down</button>-->
function myFunction() {
  let w = window.outerWidth;
  let h = window.outerHeight;
  let txt = "Window size: width=" + w + ", height=" + h;
  document.getElementById("demo").innerHTML = txt;
  //if ($(window).width()>799){$(".btn1a").hide();
//  }
  if (w<800){


Is there a question, or is this just a “look what I did” type of post?

Curious minds want to know…:shifty:

If it’s a look what I did, might I suggest a quick codepen to make it easy for everyone to see?


And if so, can the question be “how do i do this without calling the same method 20 times in a row”?

1 Like

I am sorry I did not find the option for explication. after two year I forgot a lot. I tried to build mobile first megamenu but as I refreshed it I lost all jquery settings. as I resize the window everything is back. this is where I need help please. If I refresh everything should stay as supposed to be, like resizing window. thank you fran

also there is another problem. the divcontaining a list slides down making a gap thatI do not understand. how can get ridof that gap? and make sliding div to stay right away after the ‘title bar’ div? So my questions are the previosly mentioned refresh problem and the current one, thank you , frank

anotherthing do I need codepen link or the posted code will do. thank you.

You don’t need it, but making people copy/paste your page lessens the chance you might get help.

I am sorry I made mistake, after two year forgot how to do properely. can you help me please?I see ’ ', </>, arrow up. which one is the right one? thank you

Here is a simplified non javascript example…

Full Page View

Editor View

1 Like

thank you that is lovely, that is amazing

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.