Stack top menu veritcally

I need to take the top menu and make it stack vertically based on screen size.

I can detect the screen size, just cannot get jQuery to co operate with me.

<table class="topMenu" cellspacing="0" cellpadding="0" style="width:1200px">

<tbody>
<tr>
<td class="top" title="">
<td class="top" title="">
<td class="top" title="">
<td class="top" title="">
<td class="top" title="">
<td class="top" title="">
<td class="top" title="">
<td id="tm_active" class="top" title="">
</tr>
</tbody>
</table>

The reason?
I want to stack them menu vertically when someone is using a mobile device.
 

I tried jquery myself but ended up with this...

<table class="topMenu" cellspacing="0" cellpadding="0" style="width:1200px">

<tbody>
<tr>
<td class="top" title="">
<tr></tr>
<td class="top" title="">
<tr></tr>
<td class="top" title="">
<tr></tr>
<td class="top" title="">
<tr></tr>
<td class="top" title="">
<tr></tr>
<td class="top" title="">
<tr></tr>
<td class="top" title="">
<tr></tr>
<td id="tm_active" class="top" title="">
</tr>
</tbody>
</table>

The <tr></tr> are dimmed inside firebug which means the browser is ignoring the tags.

I tried this...

$('.topMenu td:not(first)').each(function(){
      $(this).before("<tr>");
       $(this).after("</tr>");
  
 });

Any help is appreciated!

http://www.mytikibar.com
Quote · 17 Apr 2014

You probably need to look at the CSS for topMenu.

TravelNotes.org - The Online Guide to Travel
Quote · 17 Apr 2014

I would look at having the top menu wrap as the screen got smaller.  eventually they would then stack if the screen was small enough.

Geeks, making the world a better place
Quote · 17 Apr 2014

I use the "make any template responsive" mod and also had the author modify my menu (his .js file) so that only 4 items display and then the menu is cropped / wrapped.  So, 4 items and then "more."

Quote · 17 Apr 2014

Well with a table, I have to add a TR into the DOM.

I am just not having any luck.

So...  I am going to try to remove the table and make them all divs.

THAT I can control.  lol

http://www.mytikibar.com
Quote · 17 Apr 2014

Not sure why you'd want to add tr tags.  If you just change the td css rules to float:none;  and display:inline;   ... the top menu items will stack vertically.   Maybe use toggleClass()  ?

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 17 Apr 2014

Houston, you are a genius!!!

Thank you, Thank you!

 

http://www.mytikibar.com
Quote · 18 Apr 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.